Skip to content
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

Navigation: Hidden items shown when path partially matches current item #251

Open
thomasmassmann opened this issue Feb 22, 2021 · 1 comment

Comments

@thomasmassmann
Copy link
Member

If show excluded items is activated in navigation settings, a hidden content item will show up if the path partially matches the current item.

Example:

path_1 = http://localhost:8080/Plone/nachrichten
path_2 = http://localhost:8080/Plone/nach

path_2 is hidden from navigation, but shows up as soon as path_1 is the current content.

This is because in https://github.com/plone/plone.app.layout/blob/master/plone/app/layout/viewlets/common.py#L334 the compared paths don't have a trailing slash.

Proposed solution: check paths with trailing slash:

- if brain.exclude_from_nav and not context_path.startswith(brain_path):
+ if not context_path.endswith("/"):
+     context_path += "/"
+ brain_path_full = brain_path
+ if not brain_path_full.endswith("/"):
+     brain_path_full += "/"
+ if brain.exclude_from_nav and not context_path.startswith(brain_path_full):

Any thoughts on that?

@jensens
Copy link
Member

jensens commented Feb 22, 2021

That is indeed a problem. I like your proposed solution. It would be great if you can prepare a pull request!

@thomasmassmann thomasmassmann self-assigned this Feb 23, 2021
talarias pushed a commit that referenced this issue Dec 9, 2021
* import bootstrap from node_modules and use --load-path=node_modules

* create first npm release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants