Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####### Set-up for extension container to migrate from grid-elements
- TYPO3 10.4.37 in process to upgrade to v11
- Latest version of container extension
- All files are in a site_packages extension
- Steps followed to be able to Migrate from Gridelements:
- 1. created all template-files, TCA-containers Container Settings, using the same naming and colPos as in the original Gridelements.
- - The original gridelements where not using id's for the BackenLayout, but had their "alias" names instead.
- 2. run these commands in phpMyadmin:
- UPDATE `tt_content` SET `CType`=CONCAT('container-', `tx_gridelements_backend_layout`) WHERE `CType`='gridelements_pi1';
- UPDATE `tt_content` SET `colPos`= `tx_gridelements_columns`,`tx_container_parent`=`tx_gridelements_container` WHERE `colPos`=-1;
- Run upgrade in the BE-Tools
- Removed Gridelements
- ######## result
- - duplicated CE (seems to be a copy or linked with the container
- - some templates seemd to be wrong and had to be changed to the right (eddited) one manually
- - In frontend getting error no rendering definition for...
- - ERROR: Content Element with uid "221" and type "container-2_columns" has no rendering definition!
- _ indicates that the template is not found or not correct coded ...
- ############### The TCA Override php ##################
- ###########################################################
- <?php
- /*
- *
- *
- */
- if (!defined('TYPO3')) {
- die('Access denied.');
- }
- /* container 2 kolommen */
- call_user_func(function () {
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-2_columns', // CType
- '2 Column Element', // label
- '2 Column Element', // description
- [
- [
- ['name' => 'Linker Colom', 'colPos' => 0],
- ['name' => 'Rechter Colom', 'colPos' => 1]
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-2col.svg')
- );
- /* container 3 kolommen */
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-3_columns', // CType
- '3 Column Element', // label
- '3 Column Element', // description
- [
- [
- ['name' => 'Linker Colom', 'colPos' => 1],
- ['name' => 'Midden Colom', 'colPos' => 2],
- ['name' => 'Rechter Colom', 'colPos' => 3]
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-2col.svg')
- );
- /* container 40 / 60 kolommen */
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-columns_40_60', // CType
- 'columns_40_60', // label
- 'columns_40_60', // description
- [
- [
- ['name' => 'Linker inhoud', 'colPos' => 0],
- ['name' => 'Rechter inhoud', 'colPos' => 1]
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-3col.svg')
- );
- /* container 4 kolommen */
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-4cols', // CType
- '4 Colommen Element', // label
- '4 Colommen Element Voor Content', // description
- [
- [
- ['name' => 'Linker Colom', 'colPos' => 1],
- ['name' => 'Midden Eerste Colom', 'colPos' => 2],
- ['name' => 'Midden tweede Colom', 'colPos' => 3],
- ['name' => 'Rechter Colom', 'colPos' => 4],
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-4col.svg')
- );
- /* container 1 kolom */
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-1_column', // CType
- '1 Column Element', // label
- '1 Column Element', // description
- [
- [
- ['name' => '1_column', 'colPos' => 1],
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-1col.svg')
- );
- /* container standaard section */
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-section_element', // CType
- 'Default Section Element', // label
- 'Default Section voor content', // description
- [
- [
- ['name' => 'ContentColom', 'colPos' => 0],
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-1col.svg')
- );
- /* container section met 1 kolom */
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-section_1_col', // CType
- 'Section Element', // label
- 'Section voor content', // description
- [
- [
- ['name' => 'ContentColom met 1 Kolom er in', 'colPos' => 0],
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-1col.svg')
- );
- /* container met achtergrond afbeelding -- aanpassen template met {variable uit constants en of afbeelding path } */
- \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
- (
- new \B13\Container\Tca\ContainerConfiguration(
- 'container-section_element_background_img', // CType
- 'Section With Background', // label
- 'Section Met achtergrond afbeelding', // description
- [
- [
- ['name' => 'ContentColumn With Background Image', 'colPos' => 0],
- ]
- ] // grid configuration
- )
- )
- // set an optional icon configuration
- ->setIcon('EXT:container/Resources/Public/Icons/container-1col.svg')
- );
- });
- ################### The setup_container typoscript ############
- #################################################################
- ########### container 2 kolommen ##########
- tt_content.container-2_columns < lib.contentElement
- tt_content.container-2_columns {
- templateName = 2ColsContainer
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ########### container 40 /60 kolom indeling ##########
- tt_content.container-columns_40_60 < lib.contentElement
- tt_content.container-columns_40_60 {
- templateName = Columns_40_60
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ########### container 3 kolommen ##########
- tt_content.container-3_columns < lib.contentElement
- tt_content.container-3_columns {
- templateName = 3ColsContainer
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ########### container 4 kolommen ##########
- tt_content.container-4cols < lib.contentElement
- tt_content.container-4cols {
- templateName = 4ColsContainer
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ########### container section ##########
- tt_content.section-section_element < lib.contentElement
- tt_content.section-section_elementl {
- templateName = SectionContainer1
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ########### container 1 kolommen ##########
- tt_content.container-1_column < lib.contentElement
- tt_content.container-1_column {
- templateName = 1ColContainer
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ########### container section met 1 kolom ##########
- tt_content.section-section_1_col < lib.contentElement
- tt_content.section-section_1_col {
- templateName = Section_1_col
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ########### container section met 1 kolom en achtergrond afbeelding ##########
- tt_content.section-section_element_background_img < lib.contentElement
- tt_content.section-section_element_background_img {
- templateName = Section_1_col_Background_Img
- templateRootPaths {
- 10 = EXT:hocomtemplate/Resources/Private/Extensions/container/Templates/
- }
- dataProcessing {
- 100 = B13\Container\DataProcessing\ContainerProcessor
- }
- }
- ############ sample template #########################################
- ########################################################################
- <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
- <!-- 2 columns 50 / 50 for content side by side -->
- <div class="row">
- <div class="small-12 medium-6 large-6 columns">
- <f:for each="{children-0}" as="record">
- <f:format.raw>
- {record.renderedContent}
- </f:format.raw>
- </f:for>
- </div>
- <div class="small-12 medium-6 large-6 columns">
- <f:for each="{children-1}" as="record">
- <f:format.raw>
- {record.renderedContent}
- </f:format.raw>
- </f:for>
- </div>
- </div>
- </html>
- ####################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement