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

Custom URLs in a multisite setup share the same URL across all nodes. #405

Open
jlachancekffein opened this issue Sep 19, 2024 · 1 comment

Comments

@jlachancekffein
Copy link

Describe the bug

When the propagation method of a navigation is set to Save nodes to all sites enabled for this navigation, the modification of the url of a node of type Custom Url, the modification is applied to each site.

However, the label is correctly translated on each site. The issue is only with the URL.

I understand that, when I create a new node, that the same value is save in each others sites, but after modification, is suppose to apply only to the selected site.

For now, we fix it by changing the propagation mode to Only save nodes to the site they were created in but it break the relation between the navigation between site.

Im pretty sure that Craft, by default with the propagation mode set to Save nodes to all sites enabled, duplicate the content of the element in each site, but manage by sites after modification.

Steps to reproduce

  1. Create a custom URL on any site by filling in the title and URL.
  2. Switch to another site in the Navigation plugin to edit the nodes.
  3. Update the title and URL.
  4. Return to the first site to edit the custom URL.
  5. The title remains the same, but the URL is the one defined for the other site.

Craft CMS version

5.4.2

Plugin version

3.0.4

Multi-site?

Yes

Additional context

No response

@engram-design
Copy link
Member

This is a good point, and It's something that's been on my list to do for a while now. Essentially, we need to create a record of a node for each site enabled for a node.

While Craft does this automatically for a Node, because it's an element, there's only a few things that are stored site-specific through that. The title, slug, uri and content are site-specific for all Elements. You can see this in the elements_sites table.

However, the things that Navigation Nodes have such as the url, classes, urlSuffix, etc are not site-specific.

This'll be part of a larger refactor coming soon!

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