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

Add remote_url(getRemoteUrl) to link content-types in navigation #1754

Open
nileshgulia1 opened this issue Feb 22, 2024 · 4 comments
Open

Add remote_url(getRemoteUrl) to link content-types in navigation #1754

nileshgulia1 opened this issue Feb 22, 2024 · 4 comments

Comments

@nileshgulia1
Copy link
Member

nileshgulia1 commented Feb 22, 2024

When presenting a link content-type within the navigation menu, items located at the root level correctly display the remoteUrl, whereas those nested or at inner levels do not. The anticipated behavior is for remoteUrl to be returned for anonymous users.

The ongoing PR(#1654), adds remoteUrl in response to the get Navigation calls.
I would be happy to coordinate the efforts.

@nileshgulia1
Copy link
Member Author

@davisagli
Copy link
Sponsor Member

@nileshgulia1 From what I see, the remoteUrl should be added for child items here:

"href": item_remote_url if use_remote_url else item_url,

But, useRemoteUrl comes from the navtree code and it can only be true if the user is the not the creator of the link: https://github.com/plone/Products.CMFPlone/blob/97f00be8bdef1726c3e335d0fa189accfec6748e/Products/CMFPlone/browser/navtree.py#L144

Maybe I'm missing something but it would be good to understand why the existing code isn't working before we add new code.

@nileshgulia1
Copy link
Member Author

But, useRemoteUrl comes from the navtree code and it can only be true if the user is the not the creator of the link:

Hm.. I'm not sure if I get this. Anyway for now I customized it in our policy addon as it was a bit urgent eea/eea.volto.policy#19 I will come back at this and try to fix it permanently. Thanks for the tips!

@davisagli
Copy link
Sponsor Member

@nileshgulia1 In general, the design for the Link content type is to take users directly to the link target URL if the users don't have permission to edit the link, but take them to the Link content item if they have permission to edit it (otherwise they don't have a way to access the edit button)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants