Skip to content

Disregarded "show_excluded_items" in navtree #265

Description

@ZeEmEs

See also issue 190 and 192.

The behavior of "show_excluded_items" as I understand it, is not given in the navigation tree in plone 5 as compared to plone 4.
The reason is, in /plone/app/layout/navigation/navtree.py at line 317 the variable "strategy.showAllParents" doesn't get changed with the condition of "show_excluded_items" as it was before.
I couldn't really make out how "strategy.showAllParents" is set.

But I get the desired behavior by adding the condition of "show_excluded_items" to the condition in line 317 like so

if strategy.showAllParents and objPath is not None and getUtility(IRegistry)["plone.show_excluded_items"]:

For this to work in navtree.py one has to import additionally

from plone.registry.interfaces import IRegistry
from zope.component import getUtility

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions