Added base content illustration adapter
authorThierry Florac <thierry.florac@onf.fr>
Mon, 22 Oct 2018 17:11:30 +0200
changeset 188 e31ee81d146f
parent 187 7703779a6b50
child 189 a948e0a00f5c
Added base content illustration adapter
src/pyams_default_theme/component/illustration/__init__.py
--- a/src/pyams_default_theme/component/illustration/__init__.py	Mon Oct 22 17:11:06 2018 +0200
+++ b/src/pyams_default_theme/component/illustration/__init__.py	Mon Oct 22 17:11:30 2018 +0200
@@ -9,6 +9,8 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
+from pyams_content.shared.common import ISharedContent
+
 
 __docformat__ = 'restructuredtext'
 
@@ -75,6 +77,14 @@
     return None
 
 
+@adapter_config(context=(ISharedContent, IPyAMSLayer), provides=IContentNavigationIllustration)
+def shared_content_illustration_factory(context, request):
+    """Shared content illustration factory"""
+    version = context.published_version
+    if version is not None:
+        return request.registry.queyrMultiAdapter((version, request), IContentNavigationIllustration)
+
+
 @adapter_config(context=(IContentLink, IPyAMSLayer), provides=IContentNavigationIllustration)
 def content_link_illustration_factory(context, request):
     """Content link illustration factory"""