--- a/src/pyams_default_theme/features/menu/__init__.py Thu Jul 12 11:48:23 2018 +0200
+++ b/src/pyams_default_theme/features/menu/__init__.py Thu Jul 12 11:48:49 2018 +0200
@@ -16,5 +16,23 @@
# import standard library
# import interfaces
+from pyams_content.component.illustration import IBasicIllustration
+from pyams_content.component.links.interfaces import IBaseLink, IInternalLink
+from pyams_default_theme.interfaces import IContentNavigationIllustration
+from pyams_skin.layer import IPyAMSUserLayer
# import packages
+from pyams_utils.adapter import adapter_config
+
+
+@adapter_config(context=(IBaseLink, IPyAMSUserLayer), provides=IContentNavigationIllustration)
+def base_link_navigation_illustration_adapter(context, request):
+ """Base link navigation illustration adapter"""
+ illustration = IBasicIllustration(context, None)
+ if not (illustration and illustration.has_data()):
+ if IInternalLink.providedBy(context):
+ target = context.get_target()
+ if target is not None:
+ illustration = request.registry.queryMultiAdapter((target, request),
+ IContentNavigationIllustration)
+ return illustration