What happened?
Description
I have a multi site setup for different locales. When building a navigation I both tried the Entries field and the Link field to link to an entry. I don’t translate the field, since the link to the entry is the same for every website. So it doesn’t really make sense to make in translatable.
When using Entries, when I try to get the URL of the linked entry, I get the URL for the current website. When I do this for the Link field, I always get the URL for the parent website, even if it’s not the current website. After reading #15821 and #16274, this seems to be intentional behavior.
Steps to reproduce
- Create a multi website setup, where each website has it’s own URL.
- Add a new section named page. And add a new record.
- Create a new entry type named navigation link.
- Add a field of the type Entries.
- Add a field of the type Link.
- Create a new record for navigation link, link both field to the same page entry.
- In Twig get the URL of the page entry with something like the code below.
{{ dump(navigationLink.entryFieldTest.one().url) }}
{{ dump(navigationLink.linkFieldTest.value) }}
Expected behavior
It would be nice to get the linked entry URL of the current website for a non-translated Link field.
Actual behavior
For a non-translated Link field, I get the linked entry URL of the parent website.
Craft CMS version
5.5.10
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
What happened?
Description
I have a multi site setup for different locales. When building a navigation I both tried the Entries field and the Link field to link to an entry. I don’t translate the field, since the link to the entry is the same for every website. So it doesn’t really make sense to make in translatable.
When using Entries, when I try to get the URL of the linked entry, I get the URL for the current website. When I do this for the Link field, I always get the URL for the parent website, even if it’s not the current website. After reading #15821 and #16274, this seems to be intentional behavior.
Steps to reproduce
Expected behavior
It would be nice to get the linked entry URL of the current website for a non-translated Link field.
Actual behavior
For a non-translated Link field, I get the linked entry URL of the parent website.
Craft CMS version
5.5.10
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions