I have a situation where I wish to automatically set entry title based on locale entry was created in. This is what I use for title:

{{ object.locale == "jp" ? "Japanese title" : "English title"}}

This works fine but when I create an entry in Japanese locale and open it in English locale and resave it the title changes to "English title" and that's not what I want, I wish to preserve the original title. Is that possible somehow?

1 Answer 1


Completely untested, but something like this should work:

{{ !object.id ? (object.locale == "jp" ? "Japanese title" : "English title") : object.title) }}

Basically only run your logic if the entry doesn't have an ID yet (which new entries won't until they are saved).

  • Thanks to your help this is what worked: {{ object.title ? object.title : (object.locale == "jp" ? "Japanese title" : "English title ") }}
    – Mato
    Nov 20, 2020 at 14:55

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.