Cross linking between multisites #9759
Unanswered
carinameissl
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Relations don’t keep track of which site was selected when the relation was created, so this may not be possible out of the box. You could maybe keep track of which specific site you want to link to from a a separate field, such as a dropdown using LJ Dynamic Fields to dynamically populate the options based on the available sites. {{ craft.app.sites.allSites|map(s => {
value: site.id,
label: site.name,
})|json_encode }} Then in your templates, you could inject the site value into the relation query: {% set relQuery = clone(entry.myEntriesField) %}
{% if entry.relSiteId %}
{% do relQuery.siteId(entry.relSiteId) %}
{% endif %}
{% for entry in relQuery.all() %}
...
{% endfor %} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I have a multi site and want to cross-link between these sites. Is there a way to do so?
(already tried the advanced settings of entry fields - show site menu and manage relations on per site basis, unfortunately neither of these options seem to solve the issue)
Thanks! Carina
Beta Was this translation helpful? Give feedback.
All reactions