How can I ensure the label of a container element is displayed automatically in the TYPO3 backend?

I frequently utilize Container Content Elements in TYPO3 for versatile content management. The setup is straightforward, but I would like the label of the container to show by default after its addition in the backend, eliminating the need to manually input a title. This would clarify the type of container being used. Currently, without a designated title, the container appears empty. I would appreciate any suggestions on achieving this automatically.

SOLUTION (Credit to Julian):
To set a custom backend template when registering a container, use the method “setBackendTemplate” in the following file:

VENDOR/Module/Configuration/TCA/Overrides/tt_content.php

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
    (new \B13\Container\Tca\ContainerConfiguration(
        'b13-2cols-with-header-container', // CType
        '2 Column Container With Header', // label
        'Description for the container', // description
        [
            // ...
        ] // grid configuration
    ))
    ->setBackendTemplate('EXT:Module/Resources/Private/Templates/Container/Example.html')
);

The contents for the backend template located in:

EXT:Module/Resources/Private/Templates/Container/Example.html

may look like this:

<html
   xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
   xmlns:container="http://typo3.org/ns/B13/Container/ViewHelpers"
   data-namespace-typo3-fluid="true"
>

    ## Displaying CType
    Container: <strong>{CType}</strong><br>

    ## Using translation
    <f:translate key="LLL:EXT:sitepackage_example/Resources/Private/Language/locallang.xlf:container.{CType}" />

    <f:format.raw>{tx_container_grid}</f:format.raw>
</html>

To have a label automatically generated for your container elements, consider using a data provider to dynamically fetch a label based on container properties. In your TCA, you can create a label user function that retrieves details from database fields or predefined settings to formulate a relevant label. This approach allows the container label to adapt based on context, improving the clarity of the backend interface without additional manual inputs. Another potential solution is to check if any TYPO3 hooks could be leveraged for modifying label behavior dynamically.

Have you tried integrating any default label via typoscript or maybe checking if any extensions could offer a quick fix on this? Does TYPO3 offer any built-in presets for labels that can be automatically applied? I wonder how others are handling this common challenge in their setups.

Hey Alex, maybe try adjusting the pageTsConfig settings? You can create default titles using page tsconfig with the TCEFORM keyword. This way, once you add a content element, it’s already labeled. It saves time in identifying what each container is for and simplifies navigation for editors.

hum, interesting question! could using core api help in setting default labels? perhaps employing fluid templates or extending existing elements in TYPO3 might offer fresh possibilities. oh, and does customizing this feature affect performance? curious to hear about any real-time experiences or observations. :blush: