def news_archive(request, slug=getattr(default_entity,"slug", None)): instance, context, entity = common_settings(request, slug) instance.type = "sub_page" instance.view = "archive" instance.display = "news" instance.limit_to = None instance.order_by = "date" get_news_and_events(instance) meta = {"description": "Archive of news items",} title = str(entity) + " - news archive" pagetitle = str(entity) + " - news archive" main_page_body_file = "arkestra/universal_plugin_lister.html" return render_to_response( "contacts_and_people/entity_information.html", {"entity":entity, "title": title, "meta": meta, "pagetitle": pagetitle, "main_page_body_file": main_page_body_file, 'everything': instance, }, context, )
def news_archive(request, slug): instance, context, entity = common_settings(request, slug) instance.type = "sub_page" instance.view = "archive" instance.display = "news" instance.limit_to = None instance.order_by = "date" get_news_and_events(instance) meta = ({"name": "description", "content": "An archive of news items"},) title = str(entity) + " - news archive" pagetitle = str(entity) + " - news archive" main_page_body_file = "news_and_event_lists.html" return shortcuts.render_to_response( "contacts_and_people/entity_information.html", {"entity":entity, "title": title, "meta": meta, "pagetitle": pagetitle, "main_page_body_file": main_page_body_file, "news_and_events": instance, }, context, )
def render(self, context, instance, placeholder): #print self.render_template instance.entity = getattr(instance, "entity", None) or work_out_entity(context, None) instance.type = getattr(instance, "type", "plugin") try: render_template = instance.render_template except AttributeError: pass get_news_and_events(instance) context.update({ 'everything': instance, 'placeholder': placeholder, }) return context
def render(self, context, instance, placeholder): #print self.render_template print "-- in render of CMSNewsAndEventsPlugin --" instance.entity = instance.entity or work_out_entity(context, None) instance.type = "plugin" try: render_template = instance.render_template except AttributeError: pass get_news_and_events(instance) context.update({ 'entity': instance.entity, 'news': instance.news, 'actual_events': instance.events, 'layout': instance.layout, 'news_and_events': instance, 'placeholder': placeholder, }) print "returning context" return context
def news_and_events(request, slug=getattr(default_entity, "slug", None)): instance, context, entity = common_settings(request, slug) main_page_body_file = "arkestra/universal_plugin_lister.html" instance.type = "main_page" get_news_and_events(instance) meta = {"description": "Recent news and forthcoming events",} title = str(entity) + " news & events" pagetitle = str(entity) + " news & events" return render_to_response( "contacts_and_people/entity_information.html", {"entity":entity, "title": title, "meta": meta, "pagetitle": pagetitle, "main_page_body_file": main_page_body_file, 'everything': instance, }, context, )
def news_and_events(request, slug): instance, context, entity = common_settings(request, slug) main_page_body_file = "news_and_event_lists.html" instance.type = "main_page" get_news_and_events(instance) meta = ({"name": "description", "content": "Recent news and forthcoming events"},) title = str(entity) + " news & events" pagetitle = str(entity) + " news & events" return shortcuts.render_to_response( "contacts_and_people/entity_information.html", {"entity":entity, "title": title, "meta": meta, "pagetitle": pagetitle, "main_page_body_file": main_page_body_file, "news_and_events": instance, }, context, )
def all_forthcoming_events(request, slug): instance, context, entity = common_settings(request, slug) instance.type = "sub_page" instance.view = "current" instance.display = "events" instance.limit_to = None get_news_and_events(instance) meta = ({"name": "description", "content": "All forthcoming events"},) title = str(entity) + " forthcoming events" pagetitle = str(entity) + " forthcoming events" main_page_body_file = "news_and_event_lists.html" return shortcuts.render_to_response( "contacts_and_people/entity_information.html", {"entity":entity, "title": title, "meta": meta, "pagetitle": pagetitle, "main_page_body_file": main_page_body_file, "news_and_events": instance, }, context, )