Added illustration 'hidden' renderer
authorThierry Florac <thierry.florac@onf.fr>
Mon, 05 Feb 2018 17:01:56 +0100
changeset 351 ce073b17b943
parent 350 05668b699887
child 352 a84cf36e9d1b
Added illustration 'hidden' renderer
src/pyams_content/component/illustration/zmi/__init__.py
--- a/src/pyams_content/component/illustration/zmi/__init__.py	Mon Feb 05 16:57:47 2018 +0100
+++ b/src/pyams_content/component/illustration/zmi/__init__.py	Mon Feb 05 17:01:56 2018 +0100
@@ -56,6 +56,17 @@
     render = get_view_template()
 
 
+@adapter_config(name='hidden', context=(IIllustration, IPyAMSLayer), provides=IIllustrationRenderer)
+class HiddenIllustrationRenderer(BaseIllustrationRenderer):
+    """Hidden illustration renderer"""
+
+    label = _("Hidden illustration")
+    weight = -999
+
+    def render(self):
+        return ''
+
+
 @adapter_config(name='default', context=(IIllustration, IPyAMSLayer), provides=IIllustrationRenderer)
 @template_config(template='templates/renderer-default.pt', layer=IPyAMSLayer)
 class DefaultIllustrationRenderer(BaseIllustrationRenderer):