container¶
-
container
¶ -
- Type
- array
- Path
- $GLOBALS['TCA'][$table]['ctrl']
- Scope
- Display
Array to configure additional items in render containers of FormEngine, see section Node expansion.
Next to single elements, some render container allow to be "enriched" with additional information via the "node expansion" API. Currently, the
OuterWrapContainer
implementsfieldWizard
andfieldInformation
.InlineControlContainer
implementsfieldWizard
and comes with the default wizardlocalizationStateSelector
. Custom containers may implement expansion nodes, too, and if implemented correctly will automatically have their configuration merged with the definition provided in this TCA array.The basic array looks like:
'ctrl' => [ 'container' => [ '<containerRenderType>' => [ 'fieldWizard' => [ '<aName>' => [ 'renderType' => '<aRenderType>', 'before' => ['<anotherName>'], 'after' => ['<yetAnotherName>'], 'disabled' => false, 'options' => [], ], ], ], ], ],
Copied!- <containerRenderType>
-
should be a defined container render type. You can find more about the
outerWrapContainer
andinlineControlContainer
in the FormEngine documentation section on rendering. Valid types are for example:outerWrapContainer
type which corresponds to theOuterWrapContainer
(class).inlineControlContainer
type which corresponds to theInlineControlContainer
classinline
type which corresponds to theInlineControlContainer
class.
- renderType
- refers to a registered node name from
NodeFactory
- before, after
- can be set to sort single wizards relative to each other.
- disabled
- can be used to disable built in default wizards.
- options
- Some wizards may support additional "options".
Note, next to "fieldWizard", some containers may also implement "fieldInformation", which can be manipulated the same way.
Examples¶
Disable a built-in wizard¶
'ctrl' => [
'container' => [
'inlineControlContainer' => [
'fieldWizard' => [
'localizationStateSelector' => [
'disabled' => true,
],
],
],
],
],
This disables the default localizationStateSelector
fieldWizard of
inlineControlContainer
.
Add your own wizard¶
Register an own node in a ext_localconf.php
:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1486488059] = [
'nodeName' => 'ReferencesToThisRecordWizard',
'priority' => 40,
'class' => \T3G\AgencyPack\EditorsChoice\FormEngine\FieldWizard\ReferencesToThisRecordWizard::class,
];
Register the new node as "fieldWizard" of "tt_content" table in an Configuration/TCA/Overrides/tt_content.php
file:
$GLOBALS['TCA']['tt_content']['ctrl']['container'] = [
'outerWrapContainer' => [
'fieldWizard' => [
'ReferencesToThisRecordWizard' => [
'renderType' => 'ReferencesToThisRecordWizard',
],
],
],
];
In PHP, the node has to implement an interface, but can return any additional HTML which is rendered in the "OuterWrapContainer" between the record title and the field body when editing a record:
Add fieldInformation to field of type inline¶
This example can be found in Add a custom fieldInformation.