2

I'm trying to setup alternate locales for content across several sites. I have the following scenario:

- Group siteA
  - siteA.com/product-1

- Group siteB
  - siteB.com/product-2
  - siteB.com/fr/product-2

Content remains the same within a site group, where an entry in one locale is a translation of an entry another locale (as in Craft 2). Other site groups will have the same sections, but different content and perhaps locales. Propagating entries will not work in this case.

It's a scenario I've seen mentioned elsewhere, but I fail to understand the setup.

Is there a way to assign locales to multiple sites in general.php config the same way one would for siteUrl?

'production' => [
  'siteUrl' => 'siteA.com',
  'siteB' => [
    'en_gb' => 'siteB.com',
    'fr' => 'siteB.com/fr/'
  ]
],

Perhaps with alias?

Edit:

Ideally it would be something like propagating entries amongst site groups but not all sites, so product-2 would be propagated in siteB only.

1

Add your sites in the CMS, under Settings > Sites. You can setup the Base URL and language per site.

  • But how would Craft know that siteA.com/fr/product is an alternate locale for siteA.com/product? Shouldn't the relationship be defined somewhere for alternate URLs for SEO, language switch, etc...? – Paul May 11 at 7:04
  • Under Settings > Sections, you can edit a section and check 'Propagate entries accross all enabled sites'. That way, once you create an entry, it is created in all sites and you can switch between translations. – Richard May 12 at 11:15
  • Thanks, was actually looking to propagate across site groups only, which will be doable in Craft 3.2 – Paul May 21 at 3:40
0

There's actually a feature request which describes what I'm trying to achieve.

It's doable in Craft 3.2 by enabling Save entries to other sites in the same site group and managing translations at field level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.