### Install Composer Dependencies Source: https://github.com/b13/container/blob/master/Tests/README.md Run this command to install project dependencies using Composer. ```bash composer install ``` -------------------------------- ### Setup TYPO3 Extension Source: https://github.com/b13/container/blob/master/Tests/README.md Command to set up the TYPO3 extension after dependencies and configurations are in place. ```bash .Build/bin/typo3 extension:setup ``` -------------------------------- ### Start PHP Web Server Source: https://github.com/b13/container/blob/master/Tests/README.md Starts a local PHP web server on port 8080. Ensure chromedriver is also running. ```bash php -S 0.0.0.0:8080 -t .Build/Web/ & ``` -------------------------------- ### Running Extension Tests Source: https://github.com/b13/container/blob/master/README.md Instructions for setting up the environment and executing unit, functional, and acceptance tests for the container extension. Ensure composer dependencies are installed before running tests. ```bash composer install Build/Scripts/runTests.sh -s unit ``` ```bash Build/Scripts/runTests.sh -s functional ``` ```bash Build/Scripts/runTests.sh -s acceptance ``` -------------------------------- ### Start PHP Web Server with Router for TYPO3 14 Source: https://github.com/b13/container/blob/master/Tests/README.md Starts a local PHP web server with a specific router for TYPO3 version 14. Ensure chromedriver is running. ```bash cp Build/router.php .Build/Web php -S 0.0.0.0:8080 -t .Build/Web/ .Build/Web/router.php & ``` -------------------------------- ### Start ChromeDriver Source: https://github.com/b13/container/blob/master/Tests/README.md Starts the ChromeDriver service on port 9515, required for Selenium-based tests. ```bash chromedriver --url-base=/wd/hub --port=9515 & ``` -------------------------------- ### Clone TYPO3 and Apply Patch Source: https://github.com/b13/container/blob/master/Build/JavaScript/README.md Steps to clone the TYPO3 repository, checkout a specific version, apply a JavaScript patch, and install Node.js dependencies. ```bash git clone https://github.com/typo3/typo3.git git checkout 13.1 cp EXT:container/Build/JavaScript/js-13.patch . patch -p1 < js-13.patch cd Build nvm use v18.20.1 # v22.2.0 for main branch npm ci node_modules/grunt/bin/grunt scripts cp JavaScript/backend/layout-module/* EXT:container/Resources/Public/JavaScript/Overrides/ ``` -------------------------------- ### TypoScript: Minimal Container Processor Setup Source: https://context7.com/b13/container/llms.txt Configure the ContainerProcessor to auto-discover all colPos values. This makes `children_` variables available in Fluid templates. ```typoscript tt_content.my_2col_container < lib.contentElement tt_content.my_2col_container { templateName = My2ColContainer templateRootPaths { 10 = EXT:my_sitepackage/Resources/Private/Templates/Content/ } dataProcessing { 100 = B13\Container\DataProcessing\ContainerProcessor # Result: {children_201} and {children_202} available in Fluid } } ``` -------------------------------- ### Container HTML Template Example Source: https://github.com/b13/container/blob/master/README.md This HTML template iterates over children of specific column positions (colPos) and renders their header and content. Ensure the template file name matches the TypoScript configuration. ```html {record.header}
{record.renderedContent}
{record.header}
{record.renderedContent}
``` -------------------------------- ### Create Test Database Source: https://github.com/b13/container/blob/master/Tests/README.md Creates a MySQL database with the specified name, appending '_at' if it doesn't exist. ```bash mysql -e 'CREATE DATABASE IF NOT EXISTS foox_at;' ``` -------------------------------- ### Prepare Functional Tests Source: https://github.com/b13/container/blob/master/Tests/README.md Commands to prepare the environment for functional tests, including creating directories and symbolic links. ```bash mkdir -p config/system cd config && ln -s ../Build/sites && cd - cp Build/settings.php config/system ``` -------------------------------- ### Run Unit Tests Source: https://github.com/b13/container/blob/master/Tests/README.md Executes unit tests using PHPUnit with a specific configuration file and increased memory limit. ```bash php -d memory_limit=2G .Build/bin/phpunit -c Build/phpunit/UnitTests.xml Tests/Unit/ ``` -------------------------------- ### Build with Docker Source: https://github.com/b13/container/blob/master/Build/JavaScript/README.md Build TYPO3 JavaScript assets using Docker, mounting the local build directory and executing npm and grunt commands within a Node.js container. ```bash cd Build COMMAND="cd /Build; npm ci || exit 1; node_modules/grunt/bin/grunt scripts" docker run -v ${PWD}:/Build -it ghcr.io/typo3/core-testing-nodejs18:1.4 /bin/sh -c "$COMMAND" ``` -------------------------------- ### Run Codeception Tests Source: https://github.com/b13/container/blob/master/Tests/README.md Executes Codeception tests for the Backend module with local and classic environments. ```bash php -d memory_limit=2G .Build/bin/codecept run Backend --env=local,classic -c Tests/codeception.yml ``` -------------------------------- ### ContainerConfiguration Methods Source: https://github.com/b13/container/blob/master/README.md These methods allow you to configure various aspects of a container element, such as its icon, templates, and behavior in the backend. ```APIDOC ## `setIcon` ### Description Sets the icon file or identifier for the container. ### Parameters - **icon** (string) - The path to the icon file or an existing icon identifier. ### Default `'EXT:container/Resources/Public/Icons/Extension.svg'` ``` ```APIDOC ## `setBackendTemplate` ### Description Sets the template used for the backend view of the container. ### Parameters - **backendTemplate** (string) - The path to the backend template file. ### Default `'EXT:container/Resources/Private/Templates/Container.html'` ``` ```APIDOC ## `setGridTemplate` ### Description Sets the template used for the grid display of the container. ### Parameters - **gridTemplate** (string) - The path to the grid template file. ### Default `'EXT:container/Resources/Private/Templates/Grid.html'` ``` ```APIDOC ## `setGridPartialPaths` / `addGridPartialPath` ### Description Sets or adds partial root paths for the grid display. ### Parameters - **gridPartialPaths** (array) - An array of partial root paths. - **gridPartialPath** (string) - A single partial root path to add. ### Default `['EXT:backend/Resources/Private/Partials/', 'EXT:container/Resources/Private/Partials/']` ``` ```APIDOC ## `setGridLayoutPaths` ### Description Sets the layout root paths for the grid display. ### Parameters - **gridLayoutPaths** (array) - An array of layout root paths. ### Default `[]` ``` ```APIDOC ## `setSaveAndCloseInNewContentElementWizard` ### Description Configures whether the 'Save and Close' option is available in the new content element wizard. ### Parameters - **saveAndCloseInNewContentElementWizard** (bool) - `true` to enable, `false` to disable. ### Default `true` ``` ```APIDOC ## `setRegisterInNewContentElementWizard` ### Description Configures whether the container element is registered in the new content element wizard. ### Parameters - **registerInNewContentElementWizard** (bool) - `true` to register, `false` to not register. ### Default `true` ``` ```APIDOC ## `setGroup` ### Description Sets a custom group name for the container element. This is used for optgroups in the CType select and as tabs in the New Content Element Wizard. If empty, 'container' is used as the tab and no optgroup is used. ### Parameters - **group** (string) - The custom group name. ### Default `'container'` ``` ```APIDOC ## `setRelativeToField` ### Description Specifies a field to which the new content element should be added relative to. ### Parameters - **relativeToField** (string) - The name of the field to position relative to. ### Default `''` ``` ```APIDOC ## `setRelativePosition` ### Description Sets the position relative to another field. Valid keywords are 'before', 'after', 'replace'. ### Parameters - **relativeToField** (string) - The relative position keyword. ### Default `''` ``` ```APIDOC ## `setDefaultValues` ### Description Sets default values for the new content element's wizard items. ### Parameters - **defaultValues** (array) - An array of default values. ### Default `[]` ``` -------------------------------- ### Customize Backend Container Preview with Event Listener Source: https://context7.com/b13/container/llms.txt Use the BeforeContainerPreviewIsRenderedEvent to inject custom Fluid variables or change template paths for specific container types before the backend preview renders. ```php namespace MyVendor\MySitepackage\EventListener; use B13\Container\Events\BeforeContainerPreviewIsRenderedEvent; use TYPO3\CMS\Core\Attribute\AsEventListener; #[AsEventListener(identifier: 'my-sitepackage/customise-container-preview')] final class CustomiseContainerPreview { public function __invoke(BeforeContainerPreviewIsRenderedEvent $event): void { $container = $event->getContainer(); $view = $event->getView(); if ($container->getCType() === 'my_2col_container') { // Inject extra data into the backend preview template $view->assign('containerUid', $container->getUid()); $view->assign('isConnectedMode', $container->isConnectedMode()); $view->assign('childCount', count($container->getChildRecords())); } } } ``` -------------------------------- ### Run Functional Tests Source: https://github.com/b13/container/blob/master/Tests/README.md Executes functional tests using PHPUnit with a specific configuration file and increased memory limit. ```bash php -d memory_limit=2G .Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml Tests/Functional ``` -------------------------------- ### Access Container Model Data in a Data Processor Source: https://context7.com/b13/container/llms.txt Demonstrates how to use the FrontendContainerFactory to build a Container model instance within a TYPO3 DataProcessor, allowing access to raw record data, child records, and metadata. ```php // Example: custom DataProcessor accessing the Container model directly use B13\Container\Domain\Factory\FrontendContainerFactory; use B13\Container\Domain\Model\Container; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface; class MyCustomProcessor implements DataProcessorInterface { public function __construct( private readonly FrontendContainerFactory $factory, private readonly Context $context, ) {} public function process( ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData ): array { /** @var Container $container */ $container = $this->factory->buildContainer($cObj, $this->context); // Raw container tt_content record $record = $container->getContainerRecord(); // array // All child records across every colPos, flat list $allChildren = $container->getChildRecords(); // array // Children of one specific column $leftChildren = $container->getChildrenByColPos(201); // array // All registered colPos keys that actually have children $usedColPos = $container->getChildrenColPos(); // e.g. [201, 202] // Language and workspace helpers $language = $container->getLanguage(); // int $isConnected = $container->isConnectedMode(); // bool $liveUid = $container->getUidOfLiveWorkspace(); // int $processedData['containerMeta'] = [ 'uid' => $container->getUid(), 'pid' => $container->getPid(), 'cType' => $container->getCType(), 'language' => $language, 'childCount' => count($allChildren), ]; return $processedData; } } ``` -------------------------------- ### Define a Two-Column Container with B13\Container\Tca\ContainerConfiguration Source: https://context7.com/b13/container/llms.txt Use ContainerConfiguration to define a new content element type with a two-column grid layout. Configure column names, positions, and optional restrictions like allowed content types and maximum items. ```php // Configuration/TCA/Overrides/tt_content.php (inside a site package extension) $config = new \B13\Container\Tca\ContainerConfiguration( 'my_2col_container', // CType – unique identifier 'Two Column Container', // label shown in CType selector 'A container with two equal columns', // description in New Content Element Wizard [ [ // row 1 – full-width header column ['name' => 'Header Area', 'colPos' => 200, 'colspan' => 2], ], [ // row 2 – two equal columns ['name' => 'Left Column', 'colPos' => 201], ['name' => 'Right Column', 'colPos' => 202], ], [ // row 3 – restricted column (requires EXT:content_defender) [ 'name' => 'Footer (text only)', 'colPos' => 203, 'colspan' => 2, 'allowed' => ['CType' => 'text,textmedia'], 'maxitems' => 3, ], ], ] ); // Fluent builder – all setters return $this $config ->setIcon('EXT:my_sitepackage/Resources/Public/Icons/my_2col_container.svg') ->setBackendTemplate('EXT:my_sitepackage/Resources/Private/Templates/Backend/2Col.html') ->setGroup('my_elements') // tab name in New Content Element Wizard ->setSaveAndCloseInNewContentElementWizard(false) ->setDefaultValues(['header' => 'New Two Column Container']) ->setRelativeToField('textmedia') // position in CType selector ->setRelativePosition('after'); // 'before' | 'after' | 'replace' ``` -------------------------------- ### Code Quality Checks with PHPStan and CS-Fixer Source: https://github.com/b13/container/blob/master/README.md Commands to run static analysis using PHPStan and code style checks with PHP-CS-Fixer to ensure adherence to coding guidelines. Adjust memory limit as needed for analysis. ```bash php -d memory_limit=2G .Build/bin/phpstan analyse -c Build/phpstan14.neon ``` ```bash php -d memory_limit=2G .Build/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no ``` -------------------------------- ### PHP: Event Listener to Modify Container Configuration Source: https://context7.com/b13/container/llms.txt Implement a PSR-14 event listener to intercept and modify container registration before it's applied. This allows for changing grid templates, restricting column configurations, or skipping registration entirely. ```php // Classes/EventListener/ModifyContainerConfiguration.php namespace MyVendor\MySitepackage\EventListener; use B13\Container\Events\BeforeContainerConfigurationIsAppliedEvent; use TYPO3\CMS\Core\Attribute\AsEventListener; #[AsEventListener(identifier: 'my-sitepackage/modify-container-config')] final class ModifyContainerConfiguration { public function __invoke(BeforeContainerConfigurationIsAppliedEvent $event): void { $config = $event->getContainerConfiguration(); // Apply a shared grid template to every container $config->setGridTemplate('EXT:my_sitepackage/Resources/Private/Templates/Grid.html'); // Restrict colPos 201 of a specific container registered by a 3rd-party extension if ($config->getCType() === 'vendor_some_container') { $config->changeGridColumnConfiguration(201, [ 'allowed' => ['CType' => 'text,textmedia'], 'maxitems' => 5, ]); } // Completely suppress registration of an unwanted container type if ($config->getCType() === 'vendor_unwanted_container') { $event->skip(); } } } ``` -------------------------------- ### Fluid Template for Two-Column Container Source: https://context7.com/b13/container/llms.txt A basic Fluid template demonstrating how to iterate over children processed by the ContainerProcessor and render their content. It assumes variables like `leftChildren` and `rightChildren` are available. ```html

{child.header}

{child.renderedContent}
{child.renderedContent}
``` -------------------------------- ### Generate Patch File Source: https://github.com/b13/container/blob/master/Build/JavaScript/README.md Command to generate a patch file for the JavaScript assets from a specific Git tag. ```bash git format-patch 13.4 --stdout > js-13.patch ``` -------------------------------- ### Check Container Data Integrity (Read-Only) Source: https://context7.com/b13/container/llms.txt Use these read-only CLI commands to check for issues like incorrect PIDs, parent assignments, language settings, or unused column positions without making any changes to the database. ```bash # Check integrity: wrong PIDs, wrong parents, wrong language, unused colPos, etc. vendor/bin/typo3 container:integrity # Check sorting of container children (dry-run by default) vendor/bin/typo3 container:sorting vendor/bin/typo3 container:sorting 123 # limit to page 123 # Check sorting of all records in each page colPos vendor/bin/typo3 container:sorting-in-page ``` -------------------------------- ### B13\Container\Tca\ContainerConfiguration Source: https://context7.com/b13/container/llms.txt Defines a container type with its structure, labels, and optional configurations using a fluent builder interface. ```APIDOC ## B13\Container\Tca\ContainerConfiguration — Container definition object ### Description The value object used to describe a container type. Constructed with the four mandatory fields (CType, label, description, grid) and further customised through a fluent builder interface. The `grid` parameter is a two-dimensional array of rows and columns; each column entry must have at least `name` (string) and `colPos` (int), and optionally `colspan` (int), `allowed` (array, requires EXT:content_defender), `disallowed` (array), and `maxitems` (int). ### Usage Example ```php // Configuration/TCA/Overrides/tt_content.php (inside a site package extension) $config = new \B13\Container\Tca\ContainerConfiguration( 'my_2col_container', // CType – unique identifier 'Two Column Container', // label shown in CType selector 'A container with two equal columns', // description in New Content Element Wizard [ [ ['name' => 'Header Area', 'colPos' => 200, 'colspan' => 2], ], [ ['name' => 'Left Column', 'colPos' => 201], ['name' => 'Right Column', 'colPos' => 202], ], [ [ 'name' => 'Footer (text only)', 'colPos' => 203, 'colspan' => 2, 'allowed' => ['CType' => 'text,textmedia'], 'maxitems' => 3, ], ], ] ); // Fluent builder – all setters return $this $config ->setIcon('EXT:my_sitepackage/Resources/Public/Icons/my_2col_container.svg') ->setBackendTemplate('EXT:my_sitepackage/Resources/Private/Templates/Backend/2Col.html') ->setGroup('my_elements') // tab name in New Content Element Wizard ->setSaveAndCloseInNewContentElementWizard(false) ->setDefaultValues(['header' => 'New Two Column Container']) ->setRelativeToField('textmedia') // position in CType selector ->setRelativePosition('after'); // 'before' | 'after' | 'replace' ``` ``` -------------------------------- ### Container CLI Commands for Sorting Source: https://github.com/b13/container/blob/master/README.md These bash commands are used to check and fix the sorting of container children and records within page column positions. Use the --apply flag with caution as it modifies data. ```bash # Check the sorting of container children vendor/bin/typo3 container:sorting ``` ```bash # Fix the sorting of container children on page 123 vendor/bin/typo3 container:sorting --apply 123 ``` ```bash # Check the sorting of records in page colPos vendor/bin/typo3 container:sorting-in-page ``` -------------------------------- ### TypoScript: Explicit Container Processor with Custom Names Source: https://context7.com/b13/container/llms.txt Configure the ContainerProcessor with explicit colPos values and custom variable names using the 'as' property. The `skipRenderingChildContent` option can be used to omit the `renderedContent` key, and `contentId` can override the default container UID. ```typoscript tt_content.my_2col_container < lib.contentElement tt_content.my_2col_container { templateName = My2ColContainer templateRootPaths.10 = EXT:my_sitepackage/Resources/Private/Templates/Content/ dataProcessing { 200 = B13\Container\DataProcessing\ContainerProcessor 200 { colPos = 201 as = leftChildren # skipRenderingChildContent = 1 # omit renderedContent key # contentId = 42 # override – process a different container UID } 201 = B13\Container\DataProcessing\ContainerProcessor 201 { colPos = 202 as = rightChildren } } } ``` -------------------------------- ### Runtime TCA Registry Helpers Source: https://context7.com/b13/container/llms.txt Access read-only helpers from the Registry class to introspect registered containers at runtime. These helpers are useful for checking container status, retrieving definitions, and verifying content type allowances. ```php use B13\Container\Tca\Registry; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @var Registry $registry */ $registry = GeneralUtility::makeInstance(Registry::class); ``` ```php // Check whether a given CType is a registered container $registry->isContainerElement('my_2col_container'); // true | false ``` ```php // All registered container CTypes $registry->getRegisteredCTypes(); // ['my_2col_container', 'my_3col_container', ...] ``` ```php // Full grid definition for a container CType $grid = $registry->getGrid('my_2col_container'); // [ // [ ['name'=>'Left','colPos'=>201], ['name'=>'Right','colPos'=>202] ] // ] ``` ```php // Flat list of all column definitions for one container $cols = $registry->getAvailableColumns('my_2col_container'); // [ ['name'=>'Left','colPos'=>201], ['name'=>'Right','colPos'=>202] ] ``` ```php // All colPos integer values for a container $registry->getAllAvailableColumnsColPos('my_2col_container'); // [201, 202] ``` ```php // Flat list of ALL column definitions across ALL registered containers $registry->getAllAvailableColumns(); ``` ```php // content_defender configuration for a specific column $registry->getContentDefenderConfiguration('my_2col_container', 201); // ['allowedContentTypes'=>'text,textmedia', 'maxitems'=>3, ...] ``` ```php // Check whether a given CType is allowed in a specific column of a container $registry->isAllowedInColumn('text', 201, 'my_2col_container'); // true | false ``` ```php // Get the human-readable label of a container $registry->getContainerLabel('my_2col_container'); // 'Two Column Container' ``` -------------------------------- ### Container Integrity Fix CLI Commands Source: https://github.com/b13/container/blob/master/README.md A collection of CLI commands to diagnose and fix various integrity issues within containers and their associated child elements, such as language mode, parent connections, and non-existent PIDs. ```bash bin/typo3 container:fixLanguageMode ``` ```bash bin/typo3 container:fixContainerParentForConnectedMode ``` ```bash bin/typo3 container:deleteChildrenWithWrongPid ``` ```bash bin/typo3 container:deleteChildrenWithNonExistingParent ``` ```bash bin/typo3 container:deleteChildrenWithUnusedColPos ``` -------------------------------- ### TypoScript for Default Container Rendering Source: https://github.com/b13/container/blob/master/README.md Defines a container content element with default general configuration. It adds a 'children_' variable to processed data for each column position. Ensure 'templateRootPaths' is adapted to your site package or theme extension. ```typoscript tt_content.b13-2cols-with-header-container < lib.contentElement tt_content.b13-2cols-with-header-container { templateName = 2ColsWithHeader templateRootPaths { 10 = EXT:container_example/Resources/Private/Templates } dataProcessing { 100 = B13\Container\DataProcessing\ContainerProcessor } } ``` -------------------------------- ### B13\Container\Tca\Registry::configureContainer() Source: https://context7.com/b13/container/llms.txt Registers a container type with TYPO3 by taking a ContainerConfiguration object and applying it to the system. ```APIDOC ## B13\Container\Tca\Registry::configureContainer() — Register a container type ### Description The single entry point for registering a container. Call it inside `Configuration/TCA/Overrides/tt_content.php`. It dispatches a `BeforeContainerConfigurationIsAppliedEvent` before applying changes, allowing third-party code to modify or skip the configuration. Internally it adds the CType to the TCA select items, registers the icon, writes the `showitem` definition, saves the full configuration to `$GLOBALS['TCA']['tt_content']['containerConfiguration'][]`, and generates the required PageTSconfig automatically. ### Method ```php \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class) ->configureContainer( (new \B13\Container\Tca\ContainerConfiguration( 'my_2col_container', 'Two Column Container', 'A two-column layout container', [ [ ['name' => 'Left', 'colPos' => 201], ['name' => 'Right', 'colPos' => 202], ], ] )) ->setIcon('EXT:my_sitepackage/Resources/Public/Icons/my_2col_container.svg') ); // After registration, the configuration is accessible via TCA globals: // $GLOBALS['TCA']['tt_content']['containerConfiguration']['my_2col_container'] ``` ``` -------------------------------- ### TypoScript for Explicit Column Position Container Rendering Source: https://github.com/b13/container/blob/master/README.md Configures a container content element with explicitly set column positions and variable names using the ContainerProcessor. This allows for specific control over how child elements are processed and assigned to variables. Ensure 'templateRootPaths' is adapted to your site package or theme extension. ```typoscript tt_content.b13-2cols-with-header-container < lib.contentElement tt_content.b13-2cols-with-header-container { templateName = 2ColsWithHeader templateRootPaths { 10 = EXT:container_example/Resources/Private/Templates } dataProcessing { 200 = B13\Container\DataProcessing\ContainerProcessor 200 { colPos = 200 as = children_200 } 201 = B13\Container\DataProcessing\ContainerProcessor 201 { colPos = 201 as = children_201 } } } ``` -------------------------------- ### B13\Container\Tca\Registry Source: https://context7.com/b13/container/llms.txt The Registry class provides read-only helpers for introspecting registered containers at runtime. These helpers are useful for integrators who need to check container status, retrieve definitions, or verify content element compatibility. ```APIDOC ## B13\Container\Tca\Registry ### Description Provides runtime helpers to inspect registered TYPO3 content element containers. ### Methods #### `isContainerElement(string $contentType): bool` Checks if a given content element type (`CType`) is registered as a container. #### `getRegisteredCTypes(): array` Returns a list of all registered container content element types. #### `getGrid(string $contentType): array` Retrieves the grid definition for a specific container content element type. The grid is represented as a nested array of columns. #### `getAvailableColumns(string $contentType): array` Returns a flat list of all column definitions available within a specified container. #### `getAllAvailableColumnsColPos(string $contentType): array` Retrieves all column position (`colPos`) integer values for a given container. #### `getAllAvailableColumns(): array` Returns a flat list of all column definitions across all registered containers. #### `getContentDefenderConfiguration(string $contentType, int $colPos): array` Fetches the `content_defender` configuration for a specific column within a container, if EXT:content_defender is present. #### `isAllowedInColumn(string $contentType, int $colPos, string $containerContentType): bool` Checks if a given content element type is permitted to be placed in a specific column of a container. #### `getContainerLabel(string $contentType): string` Retrieves the human-readable label for a registered container content element type. ``` -------------------------------- ### Register Container Type with B13\Container\Tca\Registry::configureContainer() Source: https://context7.com/b13/container/llms.txt Register a new container type by calling Registry::configureContainer() with a ContainerConfiguration object. This method handles TCA updates, icon registration, and PageTSconfig generation. ```php // Configuration/TCA/Overrides/tt_content.php \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class) ->configureContainer( (new \B13\Container\Tca\ContainerConfiguration( 'my_2col_container', 'Two Column Container', 'A two-column layout container', [ [ ['name' => 'Left', 'colPos' => 201], ['name' => 'Right', 'colPos' => 202], ], ] )) ->setIcon('EXT:my_sitepackage/Resources/Public/Icons/my_2col_container.svg') ); // After registration, the configuration is accessible via TCA globals: // $GLOBALS['TCA']['tt_content']['containerConfiguration']['my_2col_container'] ``` -------------------------------- ### Remove children whose pid does not match their parent container's pid Source: https://context7.com/b13/container/llms.txt This command-line interface (CLI) command is used to clean up content elements by removing children whose parent process ID (pid) does not match the parent container's pid. ```APIDOC ## container:deleteChildrenWithWrongPid ### Description Removes child content elements from the TYPO3 database where their `pid` does not match the `pid` of their parent container. ### Method CLI command ### Endpoint vendor/bin/typo3 container:deleteChildrenWithWrongPid ``` -------------------------------- ### Register Two-Column Container Element Source: https://github.com/b13/container/blob/master/README.md Register a custom two-column container element with specific column configurations and an optional icon. This code should be placed in `Configuration/TCA/Overrides/tt_content.php` within your site package or theme extension. ```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 'Some Description of the Container', // description [ [ ['name' => 'header', 'colPos' => 200, 'colspan' => 2, 'allowed' => ['CType' => 'header, textmedia']] ], [ ['name' => 'left side', 'colPos' => 201], ['name' => 'right side', 'colPos' => 202] ] ] // grid configuration ) ) // set an optional icon configuration ->setIcon('EXT:container_example/Resources/Public/Icons/b13-2cols-with-header-container.svg') ); ``` -------------------------------- ### Fix Container Data Integrity with CLI Commands Source: https://context7.com/b13/container/llms.txt These CLI commands can fix various container data integrity issues. Use the `--apply` flag to persist changes and `--enable-logging` for DataHandler logging when fixing sorting. ```bash # Fix sorting – pass --apply to persist changes; add --enable-logging for DataHandler logging vendor/bin/typo3 container:sorting --apply vendor/bin/typo3 container:sorting --apply 123 --enable-logging # Fix containers translated in the wrong language mode vendor/bin/typo3 container:fixLanguageMode # Re-assign tx_container_parent for connected-mode translations vendor/bin/typo3 container:fixContainerParentForConnectedMode # Remove orphan children whose parent container no longer exists vendor/bin/typo3 container:deleteChildrenWithNonExistingParent # Remove children assigned to a colPos that is no longer defined in the container config vendor/bin/typo3 container:deleteChildrenWithUnusedColPos ``` -------------------------------- ### Delete Children with Wrong PID Source: https://context7.com/b13/container/llms.txt Use this CLI command to remove child content elements whose process ID (PID) does not match their parent container's PID. ```bash vendor/bin/typo3 container:deleteChildrenWithWrongPid ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.