#106596Remove legacy form templates
Description
The old form templates were deprecated with TYPO3 12.0, and planned to be removed with v13: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Deprecation-95456-IntroduceBootstrap5CompatibleAndAccessibleTemplates.html
But TYPO3 v13 and the current main branch still use templateVariant: version1 as the default.
The newer templates, which are based on Bootstrap 5, can be customized more easily because of the increased use of YAML options for class names.
However, in the current state, form configuration with templateVariant: version2 is unnecessarily complex: we need to set custom properties via a form variant for each form element , due to the already existing variants in the TYPO3 core.
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
templateVariant: version2
variants:
– identifier: template-variant
renderingOptions:
fieldProperties:
descriptionClassAttribute: c-form__helptext
requiredMarkClassAttribute: required
visuallyHiddenClassAttribute: u-hidden-visually
formNavigation:
navigationWrapperClassAttribute: ~
navigationClassAttribute: ~
btnPreviousClassAttribute: ‘c-btn c-btn—secondary’
btnNextClassAttribute: ‘c-btn c-btn—secondary’
btnSubmitClassAttribute: ‘c-btn c-btn—secondary’
Text:
variants:
– identifier: template-variant
properties:
containerClassAttribute: c-form__item
elementClassAttribute: ~
elementErrorClassAttribute: ~
labelClassAttribute: c-form__label
I would recommend to delete the legacy templates and remove the `templateVariant` option altogether, so that the need for form variants on each form element becomes obsolete.