Handle "first_page_only" settings property in view results portlet renderer
authorThierry Florac <tflorac@ulthar.net>
Thu, 14 Feb 2019 16:28:19 +0100
changeset 421 d13e43fc1d21
parent 420 81157b27cd0f
child 422 3254adfa8291
Handle "first_page_only" settings property in view results portlet renderer
src/pyams_default_theme/shared/view/portlet/__init__.py
--- a/src/pyams_default_theme/shared/view/portlet/__init__.py	Thu Feb 14 16:26:37 2019 +0100
+++ b/src/pyams_default_theme/shared/view/portlet/__init__.py	Thu Feb 14 16:28:19 2019 +0100
@@ -39,6 +39,14 @@
         else:
             return relative_url(target, self.request)
 
+    def render(self):
+        result = super(BaseViewItemsPortletRenderer, self).render()
+        if self.settings.first_page_only:
+            start = int(self.request.params.get('start', 0))
+            if start:
+                return ''
+        return result
+
 
 #
 # Default view portlet renderer