Cms: How do multi-site relations work?

Created on 10 Apr 2018  Â·  3Comments  Â·  Source: craftcms/cms

Description

I'm not sure if this is a bug or just a misunderstanding of how relations work with multiple sites. Let's say I have 3 sites:

  • Primary
  • Secondary
  • Tertiary

On the Secondary and Tertiary sites, I have a Structure setup for each called Secondary Pages and Tertiary Pages.

Then, on the Primary site, I have an entries field with the Sources set to Secondary Pages and Tertiary Pages. I don't have either of these checkboxes checked.

screen shot 2018-04-10 at 1 56 18 pm

If I am editing an entry on the Primary site and trying to select entries in my entries field, no entries are selectable since those entries exist on a different site than the one I am editing an entry for.

Is this a bug or intended behavior? Happy to provide logs and DB if this does sound like a bug.

Additional info

  • Craft version: Craft CMS 3.0.1
  • PHP version: 7.1.12
  • Database driver & version: MySQL 5.6.38
question

Most helpful comment

Yeah by default relational fields will relate to other elements that share the same site as the element you’re editing. Since Secondary Pages and Tertiary Pages only exist on the Secondary and Tertiary sites, they won’t be available by default to relational fields when editing elements on the Primary site.

So you’ll either need to enable both of those sections on the Primary site as well, or create 2 separate Entries fields rather than just one, and on each one, set the “Relate entries from a specific site?” option. On the first field, select the Secondary site; on the second field, select the Tertiary site. (Also only select the section that corresponds to the selected site, too.)

All 3 comments

Yeah by default relational fields will relate to other elements that share the same site as the element you’re editing. Since Secondary Pages and Tertiary Pages only exist on the Secondary and Tertiary sites, they won’t be available by default to relational fields when editing elements on the Primary site.

So you’ll either need to enable both of those sections on the Primary site as well, or create 2 separate Entries fields rather than just one, and on each one, set the “Relate entries from a specific site?” option. On the first field, select the Secondary site; on the second field, select the Tertiary site. (Also only select the section that corresponds to the selected site, too.)

I'd like to make a Feature Request to allow choosing entries from multiple sites from within an Entries field without having to enable those entries on all sites.

@kgrote That’s covered by #3584. You can add a 👍 reaction to that so you’re notified of any progress on that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

angrybrad picture angrybrad  Â·  3Comments

angrybrad picture angrybrad  Â·  3Comments

bitboxfw picture bitboxfw  Â·  3Comments

lukebailey picture lukebailey  Â·  3Comments

darylknight picture darylknight  Â·  3Comments