Reputation: 86
I have multiple forms and all have a privacy checkbox which is identified by identifier: privacyCheckbox
and I want to dynamically render/override some configuration by typoscript.
This really works fine, if I exactly know the form's identifier and the field's position:
plugin.tx_form {
settings {
formDefinitionOverrides {
# "defaultContact" is my form's name
defaultContact {
renderables {
0 {
renderables {
# "7" is the order/position of the privacy field in the form definition
7 {
renderingOptions {
translation {
arguments {
label {
0 = TEXT
0.typolink {
parameter = {$global.pids.privacyPage}
returnLast = url
forceAbsoluteUrl = 1
}
}
}
}
}
}
}
}
}
}
}
}
}
Instead of "7" I even could use aSpecificKey
, if my YAML form definition would look like ...
renderables:
myEmailKey:
defaultValue: ''
type: Text
identifier: email
label: E-Mail
aSpecificKey:
type: Checkbox
identifier: privacyCheckbox
But I want the editor allow to edit the form and rearange the fields, so it always will be saved as ...
renderables:
-
defaultValue: ''
type: Text
identifier: email
label: E-Mail
-
type: Checkbox
identifier: privacyCheckbox
... which would cause an internal numeric array of all fields.
So, now my questions:
identifier: privacyCheckbox
in the definition - is it right, that I cannot use this identifier to access a field?Upvotes: 2
Views: 788