1

The documentation doesn't say much about it, only How to access it.

What I'm trying to achieve here?

Display entries only related to a locale.


I'll present it you with an example.

There are 3 targeted locales enabled in 3 sections. 1 entry in each section, created by 3 local users. So math says, that one locale has 3 entries, where the whole example.com has 9 entries together.


So, When I try to index entries on selected section I get that:

  • example.com/section1/ -> all entries from all locales are outputted, because entries are targeted in all locales of a section.
  • example.com/locale1/section1/ -> the same situation as with example.com/section1/, except with two differences, that entries's URL has /locale1/section1/{slug} and the locale is matched with active one.

I've looked into database, and all entries published are linked with each locale, even when Local User1 published to Local1 only. If that is gonna work, I don't know, if that will have any impact on storage efficiency.

  • I probably totally misunderstood your question, right? What do you mean with "selected locale", Dominic? – carlcs Feb 17 '15 at 12:49
  • Thank you Carl and Sorry for late respond. Usually, I can respond only in evenings of UTC time. By "selected locale" is meant - selected locale for entries in section/s in template. Or I could say, if "Locale1" is active, display entries relative for "Locale1". – Dom Krulak Feb 17 '15 at 17:25
  • You mean active / selected via the lightswitch button next to the locale on the Entry Edit page. Then I probably didn't get you question as wrong as I thought... – carlcs Feb 17 '15 at 17:30
2

Craft always outputs entries in one locale only. If you really want to list all entries in all of their enabled locales you would need to explicitly query for them using the locale parameter and then merge the results.

What probably confuses you is that Craft automatically clones an entry on the first save to all other locales. Try to edit an entry / disable it for one locale only and see the differences on you index pages!

If you really don't get the locale specific content for your different URL formats

example.com
example.com/locale1

there probably goes something wrong with your setup. The first thing I would check is the index.php files (→ Localization guide – Step 5: Set up the files)!

  • The localization is set correctly, only output makes a mess with it. Yes, you're right. Craft always outputs entries in one locale only. I made a 'check' by outputting { entry.locale } in entry, and when I was at "locale1", all entries were marked with "locale1", even those, that was not published for "locale1". I want to display only those, that are published for "locale1". I'll try to find a solution, and if I succeed,I publish it. – Dom Krulak Feb 17 '15 at 17:32
  • Entries are published on all locales by default, @Dominic. You have to disable it for select locales in the CP manually! – carlcs Feb 17 '15 at 17:39
  • If I do so, than only chosen locale's user group can publish to that section. Because, Local1UserGroup have access to Local1. I want all Locales and all Locale user's groups have access to a section. Only with that difference, that entries get published to selected Locale by selected user's group. It's confusing. – Dom Krulak Feb 17 '15 at 17:56

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.