Feature #84133
closedEpic #84132: Introduce variants
Variants - Frontend implementation
100%
Description
Variants allow you to change properties of a form element.
Variants can be made under conditions.
This makes it possible to manipulate form element values, validator options, and finisher options based on conditions.
The allows among other things:
- translation of form element values depending on the frontend language
- set and remove validators of one form element depending on the value of another form element
- hide entire pages depending on the value of a form element
- set finisher values depending on the value of a form element
- hiding a form element in certain finishers and on the summary page
- and much more
This feature implements variants for frontend rendering and the ability to define variants in the formDefinition.
The implementation to define variants in the form editor is done in a separate patchset.
Examples
# translation of form element values depending on the frontend language type: Form identifier: test prototypeName: standard label: DE renderingOptions: submitButtonLabel: Abschicken variants: - identifier: language-variant-1 condition: 'siteLanguage.getLocale() == "en_US.UTF-8"' label: EN renderingOptions: submitButtonLabel: Submit renderables: - type: Page identifier: page-1 label: DE renderingOptions: previousButtonLabel: 'zurück' nextButtonLabel: 'weiter' variants: - identifier: language-variant-1 condition: 'siteLanguage.getLocale() == "en_US.UTF-8"' label: EN renderingOptions: previousButtonLabel: 'Previous step' nextButtonLabel: 'Next step' renderables: - type: Text identifier: text-1 label: DE properties: fluidAdditionalAttributes: placeholder: Platzhalter variants: - identifier: language-variant-1 condition: 'siteLanguage.getLocale() == "en_US.UTF-8"' label: EN properties: fluidAdditionalAttributes: placeholder: Placeholder
# set validators of one form element depending on the value of another form element type: Form identifier: test label: test prototypeName: standard renderables: - type: Page identifier: page-1 label: Step renderables: - defaultValue: '' type: Text identifier: text-1 label: 'Email address' variants: - identifier: variant-1 condition: 'formValues["checkbox-1"] == 1' properties: fluidAdditionalAttributes: required: 'required' validators: - identifier: NotEmpty - identifier: EmailAddress - type: Checkbox identifier: checkbox-1 label: 'Subscribe to newsletter'
# hide entire steps (form pages) depending on the value of a form element (needs https://review.typo3.org/#/c/57049/) type: Form identifier: test prototypeName: standard label: Test renderables: - type: Page identifier: page-1 label: 'Page 1' renderables: - type: Text identifier: text-1 label: 'Text 1' - type: Checkbox identifier: checkbox-1 label: 'Skip page 2' variants: - identifier: hide-1 condition: 'stepType == "SummaryPage"' renderingOptions: enabled: false - type: Page identifier: page-2 label: 'Page 2' variants: - identifier: variant-1 condition: 'formValues["checkbox-1"] == 1' renderingOptions: enabled: false renderables: - type: Text identifier: text-2 label: 'Text 2' - type: SummaryPage identifier: summarypage-1 label: 'Summary step'
# set finisher values depending on the application context type: Form identifier: test prototypeName: standard label: Test renderingOptions: submitButtonLabel: Submit finishers: - identifier: Confirmation options: message: 'Thank you' variants: - identifier: variant-1 condition: 'applicationContext matches "#Production/Local#"' finishers: - identifier: Confirmation options: message: 'ouy knahT' renderables: - type: Page identifier: page-1 label: 'Page 1' renderingOptions: previousButtonLabel: 'Previous step' nextButtonLabel: 'Next step'
# hiding a form element in certain finishers and on the summary step (needs https://review.typo3.org/#/c/57049/) type: Form identifier: test prototypeName: standard label: Test finishers: - identifier: EmailToReceiver options: subject: Testmail recipientAddress: tritum@example.org recipientName: 'Test' senderAddress: tritum@example.org senderName: tritum@example.org renderables: - type: Page identifier: page-1 label: 'Page 1' renderables: - type: Text identifier: text-1 label: 'Text 1' variants: - identifier: hide-1 renderingOptions: enabled: false condition: 'stepType == "SummaryPage" || finisherIdentifier in ["EmailToSender", "EmailToReceiver"]' - type: Text identifier: text-2 label: 'Text 2' - type: SummaryPage identifier: summarypage-1 label: 'Summary step'
Updated by Gerrit Code Review over 6 years ago
- Status changed from New to Under Review
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Ralf Zimmermann over 6 years ago
- Subject changed from Frontend implementation to Variants - Frontend implementation
Updated by Gerrit Code Review over 6 years ago
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Ralf Zimmermann over 6 years ago
- Related to Feature #83673: Make forms of EXT:form translateable added
Updated by Gerrit Code Review over 6 years ago
Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Mathias Brodala over 6 years ago
- Sprint Focus set to On Location Sprint
Will try to review this in the upcoming sprint.
Updated by Gerrit Code Review over 6 years ago
Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Ralf Zimmermann over 6 years ago
- Related to Task #82706: Fieldset labels missing in mails added
Updated by Ralf Zimmermann over 6 years ago
- Related to Feature #81593: Usage of constants in YAML files added
Updated by Ralf Zimmermann over 6 years ago
- Related to Feature #82211: Allow generlOverride in formDefinitionOverrides added
Updated by Gerrit Code Review over 6 years ago
Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Björn Jacob over 6 years ago
- Sprint Focus changed from On Location Sprint to Remote Sprint
Updated by Gerrit Code Review over 6 years ago
Patch set 31 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 32 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 33 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 34 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 35 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 36 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 37 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 38 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 39 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 40 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 41 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 42 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 43 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 44 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 45 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 46 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 47 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 48 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 49 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Anja Leichsenring over 6 years ago
- Sprint Focus changed from Remote Sprint to On Location Sprint
Updated by Gerrit Code Review over 6 years ago
Patch set 50 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 51 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 52 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 53 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 54 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 55 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 56 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 57 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 58 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 59 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 60 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 61 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 62 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Gerrit Code Review over 6 years ago
Patch set 63 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54982
Updated by Ralf Zimmermann over 6 years ago
- Status changed from Under Review to Resolved
Applied in changeset 0dcb8970178d2e6c6656d988980bfb625c4d2e86.
Updated by Susanne Moog about 6 years ago
- Related to Task #86196: Centralize ExpressionLanguage Registration via API added
Updated by Stefan Neufeind about 6 years ago
- Precedes Task #86462: form: Add documentation for variants added