b13 / container

A TYPO3 Extension for creating custom nested content elements
GNU General Public License v2.0
168 stars 67 forks source link

container 1.3.0 and Fluid based page module #139

Closed rafu1987 closed 3 years ago

rafu1987 commented 3 years ago

After the update to version 1.3.0 of container and with activated Fluid based page module, all my container elements look like this:

Bildschirmfoto 2021-03-18 um 11 05 20

When I deactivate the Fluid based page module, everything works again in backend and my content inside the container is correctly displayed.

Frontend is working fine with both page modules.

TYPO3 10.4.13 container 1.3.0 content_defender 3.1.2

EDIT: With version 1.2.0 of container and Fluid based page module, everything was working fine.

achimfritz commented 3 years ago

@rafu1987 do you use a non standard Grid-Template (because the Container Grid-Template has changed, s. https://github.com/b13/container/blob/master/Resources/Private/Templates/Grid.html) (or do you have a own previewRenderer for your container-CType?)

erredeco commented 3 years ago

I have the same issue; I am sure it worked on version 1.2.0 and I am using the standard grid-template (no setGridTemplate)

achimfritz commented 3 years ago

maybe somebody can attach a container-configuration not working (or even better a site-extension, which can be installed on a plain TYPO3-Installation, where i can reproduce this problem)

erredeco commented 3 years ago

This is a file on my site-extension /myext/Configuration/TCA/Overrides/tt_content_b13container-twocolumns.php

<?php
defined('TYPO3_MODE') || die();

(function () {
    /**
     * Add Content Element
     */
    \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->configureContainer(
        (
            new \B13\Container\Tca\ContainerConfiguration(
                'b13-container-twocolumns', // CType
                'LLL:EXT:bhsiteconf/Resources/Private/Language/backend.xlf:b13container.twocolumns.title', // label
                'LLL:EXT:bhsiteconf/Resources/Private/Language/backend.xlf:b13container.twocolumns.description', // description
                [
                    [
                        ['name' => 'LLL:EXT:bhsiteconf/Resources/Private/Language/backend.xlf:layout.column.first', 'colPos' => 100],
                        ['name' => 'LLL:EXT:bhsiteconf/Resources/Private/Language/backend.xlf:layout.column.second', 'colPos' => 101]
                    ]
                ] // grid configuration
            )
        )
        // override default configurations
        ->setIcon('twocolumns')
        ->setSaveAndCloseInNewContentElementWizard(false)
    );

    /**
     * Define fields
     */
    $GLOBALS['TCA']['tt_content']['types']['b13-container-twocolumns'] = array_replace_recursive(
        $GLOBALS['TCA']['tt_content']['types']['b13-container-twocolumns'],
        [
            'showitem' => '
                --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf: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.headers;headers,
                --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,pi_flexform,
                    --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:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
                    --palette--;;hidden,
                    --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access;access,
                --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
                    categories,
                --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
                    rowDescription,
                --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
            '
        ]
    );

})();
erredeco commented 3 years ago

[UPDATE] I found the source of the problem on my site: the EXT:gridelements was still active; the problem solved itself when deactivating it.

achimfritz commented 3 years ago

ah, ok, i see, EXT:gridelements set $GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['fluidBasedPageModule'] = false; if you not enable fluidBasedPageModule in the gridelement Extension-Configuration, not so nice ..., so either do not use EXT:gridelement, or eneable fluidBasedPageModule in the gridelement extension Configuration, or reactivate the EXT:container DrawItemHook, in your Site-Extension (s. EXT:container/ext_localconf.php Line 48ff)

        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][] =
            \B13\Container\Hooks\DrawItem::class;
rafu1987 commented 3 years ago

For me, it wasn't related to gridelements, as it wasn't installed in my system, but I found the problem. It was a combination of a custom grid template (thank you for mentioning that @achimfritz :-)) and and override on my part of the previewRenderer in TCA. Everything is back to normal now! :-)

previewRenderer = B13\Container\Backend\Preview\ContainerPreviewRenderer