-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removal of navtree_depth makes some customization difficult #292
Comments
subclassing GlobalSectionsViewlet, can't you can change the |
yes ... that's what we did, but it's not that simple, because settings is a "shortcut" for the registry ...
What we had to do :
|
Yes, fine, I was thinking to a dictionary instead of a proxy class but this is the idea. Can you can also subclass and then do something like this: class SectionNavigationViewlet(GlobalSectionsViewlet):
def update(self):
GlobalSectionsViewlet.update(self)
self.settings.navigation_depth = self.section_root.menu_depth ? Just guessing... |
@yurj with this line, as |
It seems to me that the simplest thing to do is to remove the deprecation of the old method and restore the line that uses it. |
See #301 which should be taken into account after merge, for later work. |
who is working on this? |
Since the removal of
navtree_depth
in 7e2178d, it is way more difficult to override it.For example, we have a use case for so called "site sections", where the navigation tree depth needs to be different than everywhere else in the site.
Since it is now a direct global settings call, we cannot just subclass
GlobalSectionsViewlet
locally, as we did before.Is there a performance reason for this method removal ? or maybe we could have just put a
@memoize
decorator and keep it ?Our code was :
Now, to do the same, we have to override the enormous
navtree
function (:zany_face:) or make a proxy class for navigation settings (which we did).The text was updated successfully, but these errors were encountered: