Skip to content

Commit

Permalink
Allow overiding navigation_depth via request param in GlobalSectionsV…
Browse files Browse the repository at this point in the history
…iewlet
  • Loading branch information
MrTango committed May 2, 2022
1 parent daad087 commit 10ac403
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/301.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow overiding navigation_depth via request param in GlobalSectionsViewlet [MrTango]
3 changes: 2 additions & 1 deletion plone/app/layout/viewlets/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 10ac403

Please sign in to comment.