I would like to set a language specific default value for a custom field (input or RTE field) in TYPO3 Backend, so something like setting $GLOBALS['TCA']['tx_myrecords_domain_model_record']['columns']['disclaimer']['config']['default']
, but giving it a different value, depending on the language of the record (sys_language_uid).
e.g. default value of “disclaimer” would be “Please consider our …” if the record is the default language and “Bitte beachten Sie unsere …” in the translated record (German).
AFAIK,
- I can set the default value with
TCAdefaults.tx_myrecords_domain_model_record.disclaimer
(but it would always be the same, not language dependant). This is also works with RTE fields and using HTML in the default text. - it is not possible to set a dynamic default value in TCA
- it is for example possible to set the label language-specific. This is not what I want (this sets the “label”, not the “default” and depends on the language of the BE user, not the language of the record).
TSconfig:
TCEFORM.pages.title {
label = LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:table.column
label.default = New Label
label.de = Neuer Feldname
}
https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/PageTsconfig/TceForm.html#tceform_label-example
for TYPO3 version >= v12.
4