2

I have a condition that checks entry Id. The condition seems to not work for Japanese locale but works fine on English. I would think that entry ID remains the same irrespective of the locale. Please confirm or correct me if I'm wrong.

Thanks!

2
  • The ID won't change in different locales, check this answer for reference : craftcms.stackexchange.com/questions/23710/… You could also test it in your templates e.g. {{ craft.entries.siteId(1).one().title }} {{ craft.entries.siteId(0).one().title }}
    – HendrikEng
    Commented Nov 26, 2018 at 21:13
  • Sounds like a perfect valid answer to me @HendrikEng if you want to add it. :)
    – Brad Bell
    Commented Nov 27, 2018 at 4:40

1 Answer 1

3

The ID won't change in different locales, check this answer for reference: Craft 3 language switcher

You could also test it in your templates e.g. :

{% for locale in craft.app.sites.getAllSites() %}
    {{ craft.entries.siteId(locale.id).one().id }} : {{ craft.entries.siteId(locale.id).one().title }}
{% endfor %}

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.