2

In Craft 2 you used to be able to do something like {% set entries = craft.entries.section('something').locale('de') %} but .locale() has been removed and there's nothing similar in the docs that I see.

I'm aware that the locale automatically gets included based on the url, and I'm aware that "Locales" have been replaced by "Sites", but I want to force a query of entries from a specific locale on the one and only site I have regardless of what's in the URL. How can this be done?

  • 1
    When you have only one single site then what's the purpose of specifying the site id? Locals have been replaced by sites. – Robin Schambach Mar 14 at 18:23
3

In Craft 3, you can't really have locales. If in Craft 2 you had multiple locales, that should have been automatically migrated to multiple sites (as now the site is always single locale)

Having said that, you now need to use site or siteId parameter https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#site

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.