I know how to set the default value for a text field in a blueprint:
(This snippet just overwrites an extended blueprint, so some options are missing. But this works in my setup.)
How can I set the defualts for multiple languages? I tried this:
That’s not possible and doesn’t even make sense. The default value is created when a new page is created and that page is always created in the default language first.
The language keys you can use in blueprints only refer to the selected user language, not to the translation language.
Ok, maybe I misunderstand something.
My thinking was:
- I create a new page
- the new page prepopulates a field with a default value (which seems to work)
- but in a setup where the new page has two languages, this default value is still set for the field, but on both languages
- so obv both language versions of the new page are created at same time (and receive the same default)
- so it would be cool to be able to set a default value for each language
I kind of thought this makes sense?
But I get that it’s not possible with the thing I tried.
But if you look at the file system, you will see that at the time when a new page is created, only the content file for the default language is created. The content file for non-default pages is only created in the file system once you start editing and save the non-default content.
Therefore, default values for non-default languages would have no effect anyway.
You could cheat and use a hook create the default value for the non-default languages from information in the blueprint.
I just discovered I have to use a hook anyway to emulate the old subpage builder functionality. So I think that solves my particular situation.
But just for the sake of being obnoxious:
Being able to set translations for field labels indicates that the technical potential to also translate the default values should already be in place? Since the translation happens at the same time and the values are stored in the same file?
But maybe this is too much of an edge case anyway.
Thanks for the support though!
These label translations have nothing to do with your content translations. They depend on the user language, not on the translation.
Aaah! That’s where I thought wrong! I get it now.
Thank you for your persistance!