From 10ac403fde87d7da9a9727e74932e209a80be3d8 Mon Sep 17 00:00:00 2001 From: MrTango Date: Mon, 2 May 2022 20:33:17 +0300 Subject: [PATCH] Allow overiding navigation_depth via request param in GlobalSectionsViewlet --- news/301.feature | 1 + plone/app/layout/viewlets/common.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 news/301.feature diff --git a/news/301.feature b/news/301.feature new file mode 100644 index 00000000..cabab295 --- /dev/null +++ b/news/301.feature @@ -0,0 +1 @@ +Allow overiding navigation_depth via request param in GlobalSectionsViewlet [MrTango] \ No newline at end of file diff --git a/plone/app/layout/viewlets/common.py b/plone/app/layout/viewlets/common.py index 79fb687e..280e24c2 100644 --- a/plone/app/layout/viewlets/common.py +++ b/plone/app/layout/viewlets/common.py @@ -304,11 +304,12 @@ def navtree(self): settings = self.settings if not settings.generate_tabs: return ret + navigation_depth = int(self.request.get("navigation_depth") or settings.navigation_depth) query = { "path": { "query": self.navtree_path, - "depth": settings.navigation_depth, + "depth": navigation_depth, }, "portal_type": {"query": settings.displayed_types}, "Language": self.current_language,