Add ext:container to replace gridelements in the long run

This commit is contained in:
Björn Fromme
2021-08-24 17:51:13 +02:00
parent 75e34f5d85
commit 2cb828e7e1
5 changed files with 182 additions and 122 deletions
@@ -0,0 +1,39 @@
<?php
call_user_func(function () {
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
new \B13\Container\Tca\ContainerConfiguration(
'ep_container_thirds',
'Dreispalter',
'33/33/33 Aufteilung',
[
[
['name' => 'Elemente', 'colPos' => 300, 'colspan' => 3],
]
]
)
);
$headerConfig = [
'showitem' => '
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.header;header,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.frames;frames,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.appearanceLinks;appearanceLinks,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,
--palette--;;hidden,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access;access
'
];
foreach (['ep_container_thirds'] as $field) {
$GLOBALS['TCA']['tt_content']['types'][$field] = array_replace_recursive(
$GLOBALS['TCA']['tt_content']['types'][$field],
$headerConfig
);
}
});
@@ -0,0 +1,10 @@
tt_content.ep_container_thirds =< lib.contentElement
tt_content.ep_container_thirds {
templateName = Thirds
templateRootPaths {
10 = EXT:ep_theme/Resources/Private/Templates/Container
}
dataProcessing {
100 = B13\Container\DataProcessing\ContainerProcessor
}
}
@@ -0,0 +1,22 @@
<html data-namespace-typo3-fluid="true" lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:layout name="Default"/>
<f:section name="Main">
<ep:container data="{data}" cssClasses="py-8">
<f:if condition="{data.header_layout} != 100">
<f:if condition="{data.header}">
<f:render partial="Header/Header" arguments="{header: data.header, subheader: data.subheader, layout: data.header_layout, link: data.header_link}" />
</f:if>
</f:if>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<f:for each="{children_300}" as="record">
{record.renderedContent -> f:format.raw()}
</f:for>
</div>
</ep:container>
</f:section>
</html>