{"id":21277947,"url":"https://github.com/b13/container","last_synced_at":"2026-04-01T18:26:53.632Z","repository":{"id":37797816,"uuid":"271214994","full_name":"b13/container","owner":"b13","description":"A TYPO3 Extension for creating custom nested content elements","archived":false,"fork":false,"pushed_at":"2026-03-24T06:33:55.000Z","size":1425,"stargazers_count":182,"open_issues_count":42,"forks_count":81,"subscribers_count":23,"default_branch":"master","last_synced_at":"2026-03-25T08:09:23.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-10T07:56:21.000Z","updated_at":"2026-03-24T06:33:57.000Z","dependencies_parsed_at":"2024-04-10T06:29:37.079Z","dependency_job_id":"f1131746-700f-452f-b363-4d9999cb4c91","html_url":"https://github.com/b13/container","commit_stats":{"total_commits":374,"total_committers":28,"mean_commits":"13.357142857142858","dds":"0.48930481283422456","last_synced_commit":"01ce558855f9fcb3919fc8f52bca138b1b4086ac"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/b13/container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcontainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcontainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcontainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcontainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/container/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcontainer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T10:08:22.968Z","updated_at":"2026-04-01T18:26:53.624Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/b13/container/actions/workflows/ci.yml/badge.svg)\n\n# EXT:container - A TYPO3 Extension for creating nested content elements\n\n## Features\n- Simple amazing containers (grids) as custom TYPO3 Content Elements\n- No default containers; everything will be built the way it is needed for a project\n- Supports multilanguage (connected or free mode (mixed mode not supported))\n- Supports workspaces\n- Supports colPos-restrictions if EXT:content_defender is installed\n- Frontend Rendering via DataProcessor and Fluid templates\n\n## Why did we create another \"Grid\" extension?\n\nAt b13, we've long supported gridelements, for which we are thankful, and have used this extension with great pleasure in the past.\n\nHowever, we had our pain points in the past with all the solutions we've evaluated and worked with. These are our reasons:\n\n- We wanted an extension that works with multiple versions of TYPO3 Core with the same extension to support our company's [TYPO3 upgrade strategy](https://b13.com/solutions/typo3-upgrades).\n- We wanted to overcome issues when dealing with the `colPos` field and dislike any fixed value that isn't fully compatible with TYPO3 Core.\n- We wanted a thoroughly tested extension with multilingual and workspaces functionality.\n- We wanted an extension that only does one thing: EXT:container ONLY adds tools to create and render container elements. There are no FlexForms, no permission handling, or custom rendering.\n- We wanted an extension in which every grid has its own Content Type (CType), making it as close as possible to TYPO3 Core functionality.\n- We wanted an extension where the configuration of a grid container element is located in one single place, making it easy to create custom containers.\n- We wanted an extension with a progressive development workflow. We were working on new projects in TYPO3 v10 sprint releases, needed custom container elements, and did not want to wait until TYPO3 v10 LTS.\n\n## Installation\n\nInstall this extension via `composer req b13/container` or download it from the [TYPO3 Extension Repository](https://extensions.typo3.org/extension/container/) and activate\nthe extension in the Extension Manager of your TYPO3 installation.\n\nOnce installed, add a custom content element to your site package or theme extension (see \"Adding your container element\").\n\n## Adding your container element\n\n1. Register your custom container in your site package or theme extension in `Configuration/TCA/Overrides/tt_content.php` as new Content Type\n2. Add TypoScript and your Fluid Template for frontend rendering\n3. Add an icon in Resources/Public/Icons/`\u003cCType\u003e`.svg\n\nSee [EXT:container_example](https://github.com/b13/container-example) for a simple example of a custom container.\n\n### Registration of Container Elements\n\nThis is an example of creating a two-column container. The code snippet goes into a file in your site package or theme extension in the folder `Configuration/TCA/Overrides/`. The file can have any name, but it is good practice to name it according to the database table it relates to. In this case, this would be `tt_content.php`.\n\n```php\n\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\B13\\Container\\Tca\\Registry::class)-\u003econfigureContainer(\n    (\n        new \\B13\\Container\\Tca\\ContainerConfiguration(\n            'b13-2cols-with-header-container', // CType\n            '2 Column Container With Header', // label\n            'Some Description of the Container', // description\n            [\n                [\n                    ['name' =\u003e 'header', 'colPos' =\u003e 200, 'colspan' =\u003e 2, 'allowed' =\u003e ['CType' =\u003e 'header, textmedia']]\n                ],\n                [\n                    ['name' =\u003e 'left side', 'colPos' =\u003e 201],\n                    ['name' =\u003e 'right side', 'colPos' =\u003e 202]\n                ]\n            ] // grid configuration\n        )\n    )\n    // set an optional icon configuration\n    -\u003esetIcon('EXT:container_example/Resources/Public/Icons/b13-2cols-with-header-container.svg')\n);\n```\n\n#### Methods of the ContainerConfiguration Object\n\n| Method name | Description | Parameters | Default |\n| ----------- | ----------- | ---------- | ---------- |\n| `setIcon` | icon file, or existing icon identifier | `string $icon` | `'EXT:container/Resources/Public/Icons/Extension.svg'` |\n| `setBackendTemplate` | Template for backend view| `string $backendTemplate` | `EXT:container/Resources/Private/Templates/Container.html'` |\n| `setGridTemplate` | Template for grid | `string $gridTemplate` | `'EXT:container/Resources/Private/Templates/Grid.html'` |\n| `setGridPartialPaths` / `addGridPartialPath` | Partial root paths for grid | `array $gridPartialPaths` / `string $gridPartialPath` | `['EXT:backend/Resources/Private/Partials/', 'EXT:container/Resources/Private/Partials/']` |\n| `setGridLayoutPaths` | Layout root paths for grid | `array $gridLayoutPaths` | `[]` |\n| `setSaveAndCloseInNewContentElementWizard` | saveAndClose for new content element wizard | `bool $saveAndCloseInNewContentElementWizard` | `true` |\n| `setRegisterInNewContentElementWizard` | register in new content element wizard | `bool $registerInNewContentElementWizard` | `true` |\n| `setGroup` | Custom Group (used as optgroup for CType select, and as tab in New Content Element Wizard). If empty, \"container\" is used as tab and no optgroup in CType is used. | `string $group` | `'container'` |\n| `setRelativeToField` | Add item relative to existing field. | `string $relativeToField` | `''` |\n| `setRelativePosition` | Valid keywords: `'before'`, `'after'`, `'replace'`. | `string $relativeToField` | `''` |\n| `setDefaultValues` | Default values for the newContentElement.wizardItems | `array $defaultValues` | `[]` |\n\n__Notes:__\n- If EXT:content_defender is installed, you can use `allowed`, `disallowed`, and `maxitems` in the column configuration\n- The container registry does multiple things:\n  - Adds CType to TCA select items\n  - Registers your icon\n  - Adds PageTSconfig \n  - Sets ``showitem`` for this CType (`header`)\n  - Saves the configuration in TCA in ``$GLOBALS['TCA']['tt_content']['containerConfiguration'][\u003cCType\u003e]`` for further usage\n- We provide some default icons you can use; see `Resources/Public/Icons`\n  - container-1col\n  - container-2col\n  - container-2col-left\n  - container-2col-right\n  - container-3col\n  - container-4col\n\n### TypoScript\n\nThe TypoScript is necessary to define the rendering of the container in the frontend. Normally, you will place it in your site package or theme extension near where you define other stuff regarding your content elements.\n`templateRootPaths` must be adapted to reflect the path of the HTML files in your site package or theme extension.\n\n    // default/general configuration (will add 'children_\u003ccolPos\u003e' variable to processedData for each colPos in container\n    tt_content.b13-2cols-with-header-container \u003c lib.contentElement\n    tt_content.b13-2cols-with-header-container {\n        templateName = 2ColsWithHeader\n        templateRootPaths {\n            10 = EXT:container_example/Resources/Private/Templates\n        }\n        dataProcessing {\n            100 = B13\\Container\\DataProcessing\\ContainerProcessor\n        }\n    }\n\n    // if needed, you can use ContainerProcessor with explicitly set colPos/variable values\n    tt_content.b13-2cols-with-header-container \u003c lib.contentElement\n    tt_content.b13-2cols-with-header-container {\n        templateName = 2ColsWithHeader\n        templateRootPaths {\n            10 = EXT:container_example/Resources/Private/Templates\n        }\n        dataProcessing {\n            200 = B13\\Container\\DataProcessing\\ContainerProcessor\n            200 {\n                colPos = 200\n                as = children_200\n            }\n            201 = B13\\Container\\DataProcessing\\ContainerProcessor\n            201 {\n                colPos = 201\n                as = children_201\n            }\n        }\n    }\n\n#### Options for DataProcessing\n\n| Option                      | Description                                                                                                | Default                                                      | Parameter   |\n|-----------------------------|------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|-------------|\n| `contentId`                 | id of container to to process                                                                              | current uid of content element ``$cObj-\u003edata['uid']``        | ``?int``    |\n| `colPos`                    | colPos of children to to process                                                                           | empty, all children are processed (as ``children_\u003ccolPos\u003e``) | ``?int``    |\n| `as`                        | variable to use for proceesedData (only if ``colPos`` is set)                                              | ``children``                                                 | ``?string`` |\n| `skipRenderingChildContent` | do not call ``ContentObjectRenderer-\u003erender()`` for children, (``renderedContent`` in child will not exist) | empty                                                        | ``?int``    |\n\n### Template\n\nThe HTML template file goes in the folder you defined in your TypoScript above (see `templateRootPaths`). It's important to name it exactly as defined in `templateName` in TypoScript, in this case, `2ColsWithHeader.html`. The file name is case-sensitive!\n\n```html\n\u003cf:for each=\"{children_200}\" as=\"record\"\u003e\n    {record.header} \u003cbr\u003e\n    \u003cf:format.raw\u003e\n        {record.renderedContent}\n    \u003c/f:format.raw\u003e\n\u003c/f:for\u003e\n\n\u003cf:for each=\"{children_201}\" as=\"record\"\u003e\n    {record.header} \u003cbr\u003e\n    \u003cf:format.raw\u003e\n        {record.renderedContent}\n    \u003c/f:format.raw\u003e\n\u003c/f:for\u003e\n```\n\nWith explicit colPos defined use `{children_200|201}` as set in the example above\n\n## PSR-14 Events\n\n### BeforeContainerConfigurationIsAppliedEvent\n\n* change container configuration for 3rd-party extensions container you have installed\n* apply the same configuration to all or a set of containers (e.g. ``gridTemplate``)\n* **Note** CType and Grid Structure cannot be changed (but Column Properties of the Grid)\n\n### BeforeContainerPreviewIsRendered\n\nChange view object, e.g., add variables to view or change paths\n\n## Concepts\n- Complete registration is done with one PHP call to TCA Registry\n- A container in the TYPO3 backend Page module is rendered like a page itself (see Backend/Preview/GridRenderer called in PageContentPreviewRenderingEvent Listeners)\n- For backend clipboard and drag \u0026 drop `\u003ctx_container_parent\u003e_\u003ccolPos\u003e` used in the data-colpos attribute in the wrapping CE-div Element (instead of just the colPos as in the PageLayoutView)\n- The `\u003ctx_container_parent\u003e_\u003ccolPos\u003e` parameter is resolved to `tx_container_parent` and `colPos` value in DataHandler hooks\n- When translating a container, all child elements also get translated (the child elements are not explicitly listed during the translation dialog)\n- Copying or moving children of a container copies or moves translations as well\n- Custom definitions make use of custom `colPos` values so site owners build their own elements, no fixed `colPos` given, so no interference with existing solutions\n- Each container type is just a definition for its own `CType`\n\n## CLI commands\n\nThere are several CLI commands to check/fix the integrity of the containers and their children.\n\n```bash\n# Check the sorting of container children\nvendor/bin/typo3 container:sorting\n\n# Fix the sorting of container children on page 123\nvendor/bin/typo3 container:sorting --apply 123\n\n# Check the sorting of records in page colPos\nvendor/bin/typo3 container:sorting-in-page\n\n# ??\nbin/typo3 container:fixLanguageMode\nbin/typo3 container:fixContainerParentForConnectedMode\nbin/typo3 container:deleteChildrenWithWrongPid\nbin/typo3 container:deleteChildrenWithNonExistingParent\nbin/typo3 container:deleteChildrenWithUnusedColPos\n```\n\n## TODOs\n- Integrity proofs\n- List module actions\n\n## Extension Tests and Coding Guidelines\n\nYou can run our test suite for this extension yourself:\n\n- run `composer install`\n- run `Build/Scripts/runTests.sh -s unit`\n- run `Build/Scripts/runTests.sh -s functional`\n- run `Build/Scripts/runTests.sh -s acceptance`\n\nSee Tests/README.md on how to run the tests locally (like how github-actions runs the tests).\n\nTo assure coding guidelines are fullfilled:\n\n- run ``php -d memory_limit=2G .Build/bin/phpstan analyse -c Build/phpstan14.neon``\n- run ``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``\n\n## Credits\n\nThis extension was created by Achim Fritz in 2020 for [b13 GmbH, Stuttgart](https://b13.com).\n\nFind examples, use cases, and best practices for this extension in our [container blog series on b13.com](https://b13.com/blog/flexible-containers-and-grids-for-typo3).\n\n[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of our work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Fcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fcontainer/lists"}