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

History 410

  1. Bernhard Eckl commented <span data-processor="relativetime" data-value="2025-07-16T21:10:22+00:00" > 07/16/25, 21:10 </span>

    This is not just about the not working condition, this is also that if a content element is selected and a translation of the content element TYPO3 should automatically use the element for the current language if exists (no manual condition should be necessary).

  2. Josua Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-07-18T06:45:12+00:00" > 07/18/25, 06:45 </span>

    Applied in changeset commit:9eb13eb1a0d6a40c58c3c812a2517b8c15b7e57e.