# HG changeset patch # User Thierry Florac # Date 1553596099 -3600 # Node ID 037188159cccadf85e2975d1ec2e0856c7334289 # Parent f703c55a3225cae443d2c32d73417fc23ffed526 Added navigation illustration adapter for contents which only have a navigation illustration but no header illustration diff -r f703c55a3225 -r 037188159ccc src/pyams_default_theme/component/illustration/__init__.py --- a/src/pyams_default_theme/component/illustration/__init__.py Mon Mar 18 16:54:47 2019 +0100 +++ b/src/pyams_default_theme/component/illustration/__init__.py Tue Mar 26 11:28:19 2019 +0100 @@ -17,7 +17,7 @@ from zope.location import Location from zope.schema.fieldproperty import FieldProperty -from pyams_content.component.illustration import IBasicIllustrationTarget, ILinkIllustration +from pyams_content.component.illustration import IBasicIllustrationTarget, ILinkIllustration, ILinkIllustrationTarget from pyams_content.component.illustration.interfaces import IIllustration from pyams_content.component.links import IInternalLink from pyams_content.features.renderer.interfaces import IContentRenderer @@ -70,6 +70,14 @@ return illustration +@adapter_config(context=(ILinkIllustrationTarget, IPyAMSLayer), provides=IContentNavigationIllustration) +def link_content_navigation_illustration_factory(context, request): + """Content navigation illustration adapter for basic link illustration targets""" + illustration = ILinkIllustration(context, None) + if illustration and illustration.has_data(): + return illustration + + @adapter_config(context=(ISiteRoot, IPyAMSLayer), provides=IContentHeaderIllustration) @adapter_config(context=(IBaseContent, IPyAMSLayer), provides=IContentHeaderIllustration) def base_content_header_illustration_factory(context, request):