Added optional "name" parameter to TALES illustrations extensions
authorThierry Florac <thierry.florac@onf.fr>
Mon, 18 Mar 2019 16:52:02 +0100
changeset 432 1a76f6760f1f
parent 431 33e7648c0405
child 433 66798210724b
Added optional "name" parameter to TALES illustrations extensions
src/pyams_default_theme/component/illustration/__init__.py
--- a/src/pyams_default_theme/component/illustration/__init__.py	Mon Mar 18 16:47:47 2019 +0100
+++ b/src/pyams_default_theme/component/illustration/__init__.py	Mon Mar 18 16:52:02 2019 +0100
@@ -91,10 +91,11 @@
 class PyAMSIllustrationTALESExtension(ContextRequestViewAdapter):
     """PyAMS illustration TALES extension"""
 
-    def render(self, context=None):
+    def render(self, context=None, name=''):
         if context is None:
             context = self.context
-        return self.request.registry.queryMultiAdapter((context, self.request), IContentNavigationIllustration)
+        return self.request.registry.queryMultiAdapter((context, self.request), IContentNavigationIllustration,
+                                                       name=name)
 
 
 @adapter_config(name='pyams_banner_illustration',
@@ -103,10 +104,11 @@
 class PyAMSBannerIllustrationTALESExtension(ContextRequestViewAdapter):
     """PyAMS banner illustration TALES extension"""
 
-    def render(self, context=None):
+    def render(self, context=None, name=''):
         if context is None:
             context = self.context
-        return self.request.registry.queryMultiAdapter((context, self.request), IContentBannerIllustration)
+        return self.request.registry.queryMultiAdapter((context, self.request), IContentBannerIllustration,
+                                                       name=name)
 
 
 @adapter_config(name='pyams_header_illustration',
@@ -115,10 +117,11 @@
 class PyAMSHeaderIllustrationTALESExtension(ContextRequestViewAdapter):
     """PyAMS header illustration TALES extension"""
 
-    def render(self, context=None):
+    def render(self, context=None, name=''):
         if context is None:
             context = self.context
-        return self.request.registry.queryMultiAdapter((context, self.request), IContentHeaderIllustration)
+        return self.request.registry.queryMultiAdapter((context, self.request), IContentHeaderIllustration,
+                                                       name=name)
 
 
 #