Issue Bug Closed

#106317Form element content element: tranlated element not used and variant condition on site language doesn’t work

Bernhard Eckl 03/06/25, 09:34 updated 12/02/25, 14:22

Description

I inserted a form element type content element on a form. Default language is german, additional language is english. On the english page I still got the german element in frontend. I tried to solve that via a variant condition, but did not work:

        label: Inhaltselement
        properties:
          contentElementUid: '49787'
        type: ContentElement
        identifier: contentelement-1
        variants:
          -
            identifier: language-variant-1
            condition: 'siteLanguage("locale") == "de_DE.UTF-8"'
            renderingOptions:
              enabled: false
            properties:
              contentElementUid: '49961'

Also siteLanguage(“getTypo3Language”) == “default” or similar did not work.

The only thing that worked was overriding it with Typoscript:

[siteLanguage("languageId") == "1"]
plugin.tx_form.settings {
    formDefinitionOverrides {
        identifier {
            renderables {
                0 {
                    renderables {
                        0 {
                            properties {
                                contentElementUid = 49961
                            }
                        }
                    }
                }
            }
        }
    }
}
[global]

So there are two issues:
- Translated element will not be used
- Variant condition on site language doesn’t work

Reviews 3