Skip to content

Removal of navtree_depth makes some customization difficult #292

@laulaz

Description

@laulaz

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 :

class SectionNavigationViewlet(GlobalSectionsViewlet):

    @property
    @memoize
    def navtree_depth(self):
        return self.section_root.menu_depth

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions