3

Not so much a technical question as a how-to/best practice one, here goes:

I'm building out a site that has 3 content-types (channels), a structure and a bunch of singles.

The site has 35 locales.

The pages & singles consist of normal translated content.

But the channels should be separate in each locale. Meaning, for example, that news items from en_UK should not be translatable to jp_JA. Content will be managed by a different user/group per locale and they should only see content published in their locale, not translatable entries from others.

The "best" solution we've come up with so far is to create a channel per locale. But that adds up quickly (3 x 35...), not to mention managing fields and permissions for each channel separately.

Is there a way to simplify this or are we going to have to bite the bullet?

Craft 3 and multisite sounds like a dream for this but sadly we can't wait for that 😕

1 Answer 1

6

You could have a single News section that is enabled for each of the locales, and choose which locale each entry should target from their Edit pages.

To make it easer on the authors, you can set the default status to Disabled for each of the locales, from the section’s settings. Then when creating a new entry, the authors only have to enable the one locale that they actually want the entry to be published for.

Update

As of Craft 2.6.2972, you can configure the Entries index to only show entries that are enabled for the selected locale by installing the CP JS plugin, and pasting this code into its “Additional JavaScript” setting:

Craft.defaultIndexCriteria.localeEnabled = true;

You also may want to add this bit, to ensure that entries’ locale statuses are switched on by default from the Edit Entry page, so they don’t get lost in the entry index, which is now configured to only show locale-enabled entries:

$(document).ready(function() {
    var ls = $('#locales .lightswitch').data('lightswitch');
    if (ls) {
        ls.turnOn();
    }
});
6
  • "and choose which locale each entry should target from their Edit pages" - by only giving them permission for that locale you mean? Commented Apr 11, 2017 at 14:18
  • @JanHenckens Not necessarily. If you have a section that's enabled for multiple locales, the Edit Entry pages will have a bunch of small status toggles – one per locale. So you can have an entry that is visible on the English site but not on the German site, etc. Commented Apr 11, 2017 at 17:43
  • That still leaves the English entry visible in the German backend overview, even though it's not translated in German. That's what we're trying to avoid. Commented Apr 12, 2017 at 10:17
  • 2
    @JanHenckens Yep, in this case that’s not a great UX. Updated my answer with how you can hide the undesired entries, as of (just-released) Craft 2.6.2972. Commented Apr 12, 2017 at 23:32
  • Thanks for the update but that doesn't work on our end. There's no data attribute called lightswitch. Commented Jun 30, 2017 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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