Additional fields
Additional tt_content fields can be added to your container by using the additional fields config when registering containers
In the scenario where you want to enable or disable additional fields after you have registered the containers, e.g. in a theme extension, simply call the corresponding functions
Hint
Only the configuration options 'header', 'bodytext', 'media', 'settings', 'flexform' can be changed with these functions
Enable fields for one container
setupShowItemForContainer(string $cType, array $configuration)
-
- CType
-
The container CType to change
- configuration
-
An array containing the additional fields that should be changed
//Enable header, media and bodytext fields for `b13-2cols-with-header-container`
\TRAW\ContainerWrap\Configuration\Container::setupShowItemForContainer(
'b13-2cols-with-header-container',
[
'header' => true,
'media' => true,
'bodytext' => true,
]
);
Enable fields for multiple containers
setupShowItemForContainers(array $containerCTypes, array $configuration): void
-
- containerCTypes
-
An array containing the CTypes of containers
- configuration
-
An array containing the additional fields that should be changed
//Enable the header palette for these 3 containers
\TRAW\ContainerWrap\Configuration\Container::setupShowItemForContainers(
[
'my-container-1',
'my-container-2',
'my-container-3',
],
[
'header' => true,
]
);
Enable fields for all containers
setupShowItemForAllContainers(array $configuration, array $exceptions = [])
-
- configuration
-
An array containing the additional fields that should be changed
- exceptions
-
(Optional) An array containing container CTypes where the change should NOT be applied
//Enable the bodytext field for all containers, except these 2 containers
\TRAW\ContainerWrap\Configuration\Container::setupShowItemForAllContainers(
[
'bodytext' => true,
],
[
'my-container-3',
'my-container-4'
]
);