From 0294ba45d072528c5686ce06fb2a2301c9216289 Mon Sep 17 00:00:00 2001 From: Greg Turner Date: Mon, 5 Dec 2016 12:26:08 +1100 Subject: [PATCH 1/2] Change import location to avoid import errors --- icekit/publishing/admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/icekit/publishing/admin.py b/icekit/publishing/admin.py index 18c37ec7..da29ad65 100644 --- a/icekit/publishing/admin.py +++ b/icekit/publishing/admin.py @@ -20,8 +20,6 @@ from fluent_pages.adminui.pageadmin import _select_template_name from fluent_pages.adminui.urlnodeparentadmin import UrlNodeParentAdmin -from icekit.admin_mixins import FluentLayoutsMixin - from .models import PublishingModel @@ -723,6 +721,9 @@ class ICEKitFluentPagesParentAdminMixin( list_filter = (PublishingStatusFilter, PublishingPublishedFilter) +# this import must go here to avoid import errors +from icekit.admin_mixins import FluentLayoutsMixin + class PublishableFluentContentsAdmin(PublishingAdmin, FluentLayoutsMixin): """ Add publishing admin features for models with Fluent Contents features From bfaff0d6b758331281df990f8f83d044691f663a Mon Sep 17 00:00:00 2001 From: Sam Minton Date: Tue, 6 Dec 2016 10:37:15 +1100 Subject: [PATCH 2/2] Add OG tags content to ListableMixin --- icekit/mixins.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/icekit/mixins.py b/icekit/mixins.py index 0d6ae4bb..b05e796a 100644 --- a/icekit/mixins.py +++ b/icekit/mixins.py @@ -200,6 +200,23 @@ def get_boosted_search_terms(self): def get_oneliner(self): return getattr(self, 'oneliner', "") + def get_og_title(self): + """ + return meta_title if exists otherwise fall back to title + """ + if hasattr(self, 'meta_title') and self.meta_title: + return self.meta_title + return self.get_title() + + def get_og_image(self): + return self.get_list_image() + + def get_og_desciption(self): + if hasattr(self, 'meta_description') and self.meta_description: + return self.meta_description + return self.get_oneliner() + + class HeroMixin(models.Model): """