diff --git a/news/301.feature b/news/301.feature new file mode 100644 index 000000000..011a6fb0a --- /dev/null +++ b/news/301.feature @@ -0,0 +1,2 @@ +- Allow overriding navigation_depth via request parameter in GlobalSectionsViewlet [MrTango] +- Add global_sections view to only render GlobalSectionsViewlet to be able to pull it via AJAX [MrTango] \ No newline at end of file diff --git a/plone/app/layout/navigation/sections.pt b/plone/app/layout/navigation/sections.pt new file mode 100644 index 000000000..29668abe0 --- /dev/null +++ b/plone/app/layout/navigation/sections.pt @@ -0,0 +1,11 @@ + +
+ + + \ No newline at end of file diff --git a/plone/app/layout/viewlets/common.py b/plone/app/layout/viewlets/common.py index 79fb687e9..280e24c2f 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,