diff --git a/Classes/Listener/BeforeContainerConfigurationIsApplied.php b/Classes/Listener/BeforeContainerConfigurationIsApplied.php
index 52dea1d..584a748 100644
--- a/Classes/Listener/BeforeContainerConfigurationIsApplied.php
+++ b/Classes/Listener/BeforeContainerConfigurationIsApplied.php
@@ -21,7 +21,7 @@ public function __invoke(BeforeContainerConfigurationIsAppliedEvent $e)
$configuration = $e->getContainerConfiguration();
if ($configuration->getCType() === 'b13-2cols') {
$configuration->setDescription('mod -- ' . $configuration->getDescription());
- $configuration->changeGridColumnConfiguration(201, ['disallowed' => ['CType' => 'uploads, image']]);
+ $configuration->changeGridColumnConfiguration(201, ['disallowedContentTypes' => 'uploads, image']);
}
}
}
diff --git a/Configuration/Sets/ContainerExampleContentArea/config.yaml b/Configuration/Sets/ContainerExampleContentArea/config.yaml
new file mode 100644
index 0000000..04aa21c
--- /dev/null
+++ b/Configuration/Sets/ContainerExampleContentArea/config.yaml
@@ -0,0 +1,4 @@
+name: b13/container-example/content-area
+label: Container Example with Content Area Renderer
+dependencies:
+ - typo3/fluid-styled-content
\ No newline at end of file
diff --git a/Configuration/Sets/ContainerExampleContentArea/setup.typoscript b/Configuration/Sets/ContainerExampleContentArea/setup.typoscript
new file mode 100644
index 0000000..ed4dd7f
--- /dev/null
+++ b/Configuration/Sets/ContainerExampleContentArea/setup.typoscript
@@ -0,0 +1,12 @@
+tt_content.b13-2cols < lib.contentElement
+tt_content.b13-2cols {
+ templateName = 2Cols
+ templateRootPaths.10 = EXT:container_example/Resources/Private/ContentAreaTemplates
+ dataProcessing.10 = B13\Container\DataProcessing\ContentAreaProcessor
+}
+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/ContentAreaTemplates
+ dataProcessing.10 = B13\Container\DataProcessing\ContentAreaProcessor
+}
diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php
index 28e61f6..9f85569 100644
--- a/Configuration/TCA/Overrides/tt_content.php
+++ b/Configuration/TCA/Overrides/tt_content.php
@@ -1,14 +1,24 @@
configureContainer(
- (
+call_user_func(static function () {
+
+ $typo3 = (new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion();
+ $restrictionKey = 'allowedContentTypes';
+ $restrictions = 'header, textmedia, b13-2cols';
+ if ($typo3 < 14) {
+ $restrictionKey = 'allowed';
+ $restrictions = ['CType' => 'header, textmedia, b13-2cols'];
+ }
+
+ \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, b13-2cols']]
+ ['name' => 'header', 'colPos' => 200, 'colspan' => 2, $restrictionKey => $restrictions]
],
[
['name' => 'left side', 'colPos' => 201],
@@ -16,19 +26,25 @@
]
] // grid configuration
)
- )
- // override default configurations
- ->setIcon('EXT:container_example/Resources/Public/Icons/b13-2cols-with-header-container.svg')
- ->setSaveAndCloseInNewContentElementWizard(false)
- ->setDefaultValues(['header' => 'my-default-value-header'])
-);
+ )
+ // override default configurations
+ ->setIcon('EXT:container_example/Resources/Public/Icons/b13-2cols-with-header-container.svg')
+ ->setSaveAndCloseInNewContentElementWizard(false)
+ ->setDefaultValues(['header' => 'my-default-value-header'])
+ );
// override default settings
-$GLOBALS['TCA']['tt_content']['types']['b13-2cols-with-header-container']['showitem'] = 'sys_language_uid,CType,header,tx_container_parent,colPos';
+ $GLOBALS['TCA']['tt_content']['types']['b13-2cols-with-header-container']['showitem'] = 'sys_language_uid,CType,header,tx_container_parent,colPos';
+ $restrictionKey = 'allowedContentTypes';
+ $restrictions = 'header';
+ if ($typo3 < 14) {
+ $restrictionKey = 'allowed';
+ $restrictions = ['CType' => 'header'];
+ }
// second container
-\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
+ \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
+ (
new \B13\Container\Tca\ContainerConfiguration(
'b13-2cols', // CType
'2 Column', // label
@@ -36,14 +52,14 @@
[
[
['name' => '2-cols-left', 'colPos' => 200, 'maxitems' => 1],
- ['name' => '2-cols-right', 'colPos' => 201, 'allowed' => ['CType' => 'header']]
+ ['name' => '2-cols-right', 'colPos' => 201, $restrictionKey => $restrictions]
]
] // grid configuration
)
- )->setBackendTemplate('EXT:container_example/Resources/Private/Templates/BackendTemplate.html')
-);
-\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
+ )->setBackendTemplate('EXT:container_example/Resources/Private/Templates/BackendTemplate.html')
+ );
+ \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
+ (
new \B13\Container\Tca\ContainerConfiguration(
'b13-1col', // CType
'1 Column', // label
@@ -54,5 +70,7 @@
]
] // grid configuration
)
- )->setRegisterInNewContentElementWizard(false)
-);
+ )->setRegisterInNewContentElementWizard(false)
+ );
+});
+
diff --git a/Configuration/TypoScript/2cols.typoscript b/Configuration/TypoScript/2cols.typoscript
deleted file mode 100644
index 03a10f7..0000000
--- a/Configuration/TypoScript/2cols.typoscript
+++ /dev/null
@@ -1 +0,0 @@
-@import 'EXT:container_example/Configuration/Sets/ContainerExample/TypoScript/2Cols/setup.typoscript'
\ No newline at end of file
diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript
deleted file mode 100644
index 393759f..0000000
--- a/Configuration/TypoScript/setup.typoscript
+++ /dev/null
@@ -1 +0,0 @@
-@import 'EXT:container_example/Configuration/Sets/ContainerExample/TypoScript/2ColsWithHeader/setup.typoscript'
\ No newline at end of file
diff --git a/Resources/Private/ContentAreaTemplates/2Cols.html b/Resources/Private/ContentAreaTemplates/2Cols.html
new file mode 100644
index 0000000..b663fc4
--- /dev/null
+++ b/Resources/Private/ContentAreaTemplates/2Cols.html
@@ -0,0 +1,9 @@
+
+