Giter VIP home page Giter VIP logo

container's Introduction

CI

EXT:container - A TYPO3 Extension for creating nested content elements

Features

  • Simple amazing containers (grids) as custom TYPO3 Content Elements
  • No default containers, everything will be built the way its needed for a project
  • Supports multilanguage (connected or free mode (mixed mode not supported))
  • Supports workspaces
  • Supports colPos-restrictions if EXT:content_defender >= 3.1.0 is installed
  • Frontend Rendering via DataProcessor and Fluid templates

Why did we create another "Grid" extension?

At b13 we've been long supporters and fans of gridelements, which we are thankful for and we used it in the past with great pleasure.

However, we had our pain points in the past with all solutions we've evaluted and worked with. These are our reasons:

  • We wanted an extension that works with multiple versions of TYPO3 Core with the same extension, to support our company's TYPO3 upgrade strategy.
  • We wanted to overcome issues when dealing with colPos field and dislike any fixed value which isn't fully compatible with TYPO3 Core.
  • We wanted an extension that is fully tested with multilingual and workspaces functionality.
  • We wanted an extension that only does one thing: EXT:container ONLY adds tools to create and render container elements, and nothing else. No FlexForms, no permission handling or custom rendering.
  • We wanted an extension where every grid has its own Content Type (CType) making it as close to TYPO3 Core functionality as possible.
  • We wanted an extension where the configuration of a grid container element is located at one single place to make creation of custom containers easy.
  • We wanted an extension that has a progressive development workflow: We were working with new projects in TYPO3 v10 sprint releases and needed custom container elements and did not want to wait until TYPO3 v10 LTS.

Installation

Install this extension via composer req b13/container or download it from the TYPO3 Extension Repository and activate the extension in the Extension Manager of your TYPO3 installation.

Once installed, add a custom content element to your sitepackage or theme extension (see "Adding your own container element").

Adding your own container element

  1. Register your custom container in your sitepackage or theme extension in Configuration/TCA/Overrides/tt_content.php as new Content Type
  2. Add TypoScript and your Fluid Template for frontend rendering
  3. Add an icon in Resources/Public/Icons/<CType>.svg

See EXT:container_example for a simple example of a custom container.

Registration of Container Elements

This is an example to create a 2 column container. The code snippet goes into a file in your sitepackage 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.

\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']]
                ],
                [
                    ['name' => 'left side', 'colPos' => 201],
                    ['name' => 'right side', 'colPos' => 202]
                ]
            ] // grid configuration
        )
    )
    // set an optional icon configuration
    ->setIcon('EXT:container_example/Resources/Public/Icons/b13-2cols-with-header-container.svg')
);

Methods of the ContainerConfiguration Object

Method name Description Parameters Default
setIcon icon file, or existing icon identifier string $icon 'EXT:container/Resources/Public/Icons/Extension.svg'
setBackendTemplate Template for backend view string $backendTemplate null'
setGridTemplate Template for grid string $gridTemplate 'EXT:container/Resources/Private/Templates/Container.html'
setGridPartialPaths / addGridPartialPath Partial root paths for grid array $gridPartialPaths / string $gridPartialPath ['EXT:backend/Resources/Private/Partials/', 'EXT:container/Resources/Private/Partials/']
setGridLayoutPaths Layout root paths for grid array $gridLayoutPaths []
setSaveAndCloseInNewContentElementWizard saveAndClose for new content element wizard bool $saveAndCloseInNewContentElementWizard true
setRegisterInNewContentElementWizard register in new content element wizard bool $registerInNewContentElementWizard true
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'
setDefaultValues Default values for the newContentElement.wizardItems array $defaultValues []

Notes:

  • If EXT:content_defender >= 3.1.0 is installed you can use allowed, disallowed and maxitems in the column configuration
  • The container registry does multiple things:
    • Adds CType to TCA select items
    • Registers your icon
    • Adds PageTSconfig for newContentElement.wizardItems
    • Sets showitem for this CType (sys_language_uid,CType,tx_container_parent,colPos,hidden)
    • Saves the configuration in TCA in $GLOBALS['TCA']['tt_content']['containerConfiguration'][<CType>] for further usage
  • We provide some default icons you can use, see Resources/Public/Icons
    • container-1col
    • container-2col
    • container-2col-left
    • container-2col-right
    • container-3col
    • container-4col

TypoScript

The TypoScript is necessary to define the rendering of the container in the frontend. Normally you will place it in your sitepackage or theme extension near the place where you define other stuff regarding your content elements. templateRootPaths must be adapted to reflect the path of the html files in your sitepackage or theme extension.

// default/general configuration (will add 'children_<colPos>' variable to processedData for each colPos in container
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/Templates
    }
    dataProcessing {
        100 = B13\Container\DataProcessing\ContainerProcessor
    }
}

// if needed you can use ContainerProcessor with explicitly set colPos/variable values
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/Templates
    }
    dataProcessing {
        200 = B13\Container\DataProcessing\ContainerProcessor
        200 {
            colPos = 200
            as = children_200
        }
        201 = B13\Container\DataProcessing\ContainerProcessor
        201 {
            colPos = 201
            as = children_201
        }
    }
}

Options for DataProcessing

Option Description Default Parameter
contentId id of container to to process current uid of content element $cObj->data['uid'] ?int
colPos colPos of children to to process empty, all children are processed (as children_<colPos>) ?int
as variable to use for proceesedData (only if colPos is set) children ?string
skipRenderingChildContent do not call ContentObjectRenderer->render() for children, (renderedContent in child will not exist) empty ?int

Template

The html template file goes in the folder that you have defined in your TypoScript above (see templateRootPaths). It's important to name it exacly as defined in templateName in TypoScript, in this case 2ColsWithHeader.html. The file name is case-sensitive!

<f:for each="{children_200}" as="record">
    {record.header} <br>
    <f:format.raw>
        {record.renderedContent}
    </f:format.raw>
</f:for>

<f:for each="{children_201}" as="record">
    {record.header} <br>
    <f:format.raw>
        {record.renderedContent}
    </f:format.raw>
</f:for>

With explicit colPos defined use {children_200|201} as set in the example above

Concepts

  • Complete registration is done with one PHP call to TCA Registry
  • A container in the TYPO3 backend Page module is rendered like a page itself (see View/ContainerLayoutView)
  • For backend clipboard and drag & drop <tx_container_parent>_<colPos> used in the data-colpos attribute in the wrapping CE-div Element (instead of just the colPos as in the PageLayoutView)
  • The <tx_container_parent>_<colPos> parameter is resolved to tx_container_parent and colPos value in DataHandler hooks
  • When translating a container, all child elements get also translated (the child elements are not explicit listed during the translation dialog)
  • Copying or moving children of a container copies or moves translations as well
  • 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
  • Each container type is just a definition for its own CType

CLI commands

There's several CLI commands to check/fix the integrity of the containers and their children.

# Check the sorting of container children
vendor/bin/typo3 container:sorting

# Fix the sorting of container children on page 123
vendor/bin/typo3 container:sorting --apply 123

# Check the sorting of records in page colPos
vendor/bin/typo3 container:sorting-in-page

# ??
bin/typo3 container:fixLanguageMode
bin/typo3 container:fixContainerParentForConnectedMode
bin/typo3 container:deleteChildrenWithWrongPid
bin/typo3 container:deleteChildrenWithNonExistingParent

TODOs / Proofments

  • Integrity proofment
  • List module actions

Extension Tests and Coding Guidelines

You can run our test suite for this extension yourself:

  • run composer install
  • run Build/Scripts/runTests.sh -s unit
  • run Build/Scripts/runTests.sh -s functional
  • run Build/Scripts/runTests.sh -s acceptance

See Tests/README.md how to run the tests local (like github-actions runs the tests).

To assure coding guidelines are fullfilled:

  • run .Build/bin/phpstan analyse -c Build/phpstan10.neon
  • run .Build/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no

Credits

This extension was created by Achim Fritz in 2020 for b13 GmbH, Stuttgart.

Find examples, use cases and best practices for this extension in our container blog series on b13.com.

Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.

container's People

Contributors

achimfritz avatar achimfritz-b13 avatar bmack avatar buepro avatar davidhedden avatar davidsteeb avatar dennismetz avatar dmitryd avatar ervaude avatar extcode avatar georgringer avatar jaykju avatar jschlier avatar kevin-appelt avatar kitzberger avatar lolli42 avatar maxmishyn avatar mbrodala avatar nhovratov avatar nigelmann avatar o-ba avatar ochorocho avatar peterkraume avatar philippkuhlmay avatar ralessandri avatar saitho avatar sbuerk avatar schloram avatar schugabe avatar smove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

container's Issues

Exception after Update to version 1.1.0

I did an update to version 1.1.0 in a TYPO3 10.4.5. installation via composer:

composer update b13/container --with-all-dependencies

After that, I only received an exception in Backend, Frontend an Installtool:

(1/1) InvalidArgumentException
Expected an implementation of "phpDocumentor\Reflection\DocBlock\Tag". Got: "TYPO3\CMS\Extbase\Reflection\DocBlock\Tags\Null_"

During the update, some dependencies were updated too:

Package operations: 2 installs, 12 updates, 0 removals
  - Updating symfony/polyfill-ctype (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-php80 (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-mbstring (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-php72 (v1.17.0 => v1.18.0): Downloading (100%)         
  - Installing paragonie/random_compat (v9.99.99): Downloading (100%)         
  - Installing symfony/polyfill-php70 (v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-intl-normalizer (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-intl-idn (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-intl-icu (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-intl-grapheme (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating symfony/polyfill-php73 (v1.17.1 => v1.18.0): Downloading (100%)         
  - Updating webmozart/assert (1.9.0 => 1.9.1): Downloading (100%)         
  - Updating phpdocumentor/reflection-docblock (5.1.0 => 5.2.0): Downloading (100%)         
  - Updating b13/container (1.0.0 => 1.1.0): Downloading (100%)  

2020-07-21_10-36-34

Add declare strict_types

Hello,

you are using strict data types nearly everywhere, but you are not using declare(strict_types = 1);
Please add this declaration in top of your PHP classes.

In your Container class you're missing an int type for $language in its contructor.

Stefan

Error on first install

I am very exited about this new approach!

But...

Installed container and container_example
Added a '2 Column Container With Header' to the page and got following error:

ERROR: Content Element with uid "1" and type "b13-2cols-with-header-container" has no rendering definition!

So in the typoscript is defined:

templateRootPaths {
        10 = EXT:container/Resources/Private/Contenttypes
    }

There is no such folder?

Or did I miss something?

Please update/precise the installation instruction.

Add FrontendRestrictionContainer

Hello,

In Database::getQueryBuilder() you only check against TYPO3_MODE BE, but in case of FE you should add FrontendRestrictionContainer instead of using the DefaultRestrictionContainer.

Stefan

Provide grid icons

It would be great if the extension would provide couple of icons for the most used grid types like: 1col, 2col, 3col, 1/3+2/3, 2/3+1/3. What do you think?

Exception in v9 in BE PageLayout View

Declaration of B13\Container\View\ContainerLayoutView::getIcon($table, $row) should be compatible with TYPO3\CMS\Backend\View\PageLayoutView::getIcon($table, $row, $enabledClickMenuItems = '')

Provide setters for all properts of ContainerConfiguration

It would be nice to have setters for all properties of ContainerConfiguration.

Currently I need to do something like this

$container = new \B13\Container\Tca\ContainerConfiguration(
        'container-tabs',
        'Tab Container',
        'Container Element mit Tabs',
        [
            [
                [
                    'name' => 'Inhalt',
                    'colPos' => 201
                ]
            ]
        ],
    );
    $container->setIcon('container-tabs');

but I am really bad with those big constructur injections.
So I would prefer something

$container = new \B13\Container\Tca\ContainerConfiguration('container-tabs);
$container->setTitle('Tab Container');
...

Show header field for container element

The header field should be shown as it might be useful for styling but more important not showing it can lead so something like this

grafik
having a (copy 1) label which can't be really edited by editors (at least in page module)

what about using something like in HTML element with a label Name (not visible in frontend)

Missing commas in example of README.md

Hello,

I have tried copy&paste your example in README.md into my IDE which shows me some PHP errors.
After the closing ] you have missed a comma and in each further line the commas are missing

Stefan

Support for Ext: content_defender "disallowed"

It would be great if not only "allowed" but also "disallowed" would be supported. Thus I can prevent an editor from putting a container CType inside a container CType.
Very good extension, thanks for sharing!
Riona

tt_content-php

Provide .gitattributes

Maybe you wanna provide an .gitattributes file to skip e.g. Build directory and other files?

[IMPROVEMENT] Readme: Examples have different values for colPos

Hi,

i am testing your extension right now. So far it works very well. Good job!
When testing quick and dirty with copy & paste i found some minor possible improvements:

In your TCA Example you are using the values 200, 201, 202.
Further down in the template and typoscript Example you are using 100, 101, 102
Found here: https://github.com/b13/container

This could be normalized to improve accessibility by people who are new to the TYPO3 game :)

Best regards,
Nico

Fatal error: ContainerLayoutView::$nextThree must be public

In TYPO3 9, I get this error in page module when it contains a container element:

Fatal error: Access level to B13\Container\View\ContainerLayoutView::$nextThree must be public (as in class TYPO3\CMS\Backend\View\PageLayoutView) in /var/www/html/v9/public/typo3conf/ext/container/Classes/View/ContainerLayoutView.php on line 0

In TYPO3 10, the same configuration works. I've used the default configuration from README.md

Wrap content of ext_localconf into call_user_func

Hello,

as you're working with variables ($packageManager) in ext_localconf.php this may generate side-effects with other extensions while merging all ext_localconf.php's into one big file. To prevent side-effects please wrap content into a call_user_func.

Stefan

[BUG] Translation of additional content in containers

When you add content to container in default language and use "Translate" button in Page>Languages view, then translate configurator crashes on last step - loader does not disappear from view in fe and after browser refresh target child content is still not translated.

image
image
image

EXT:container 1.1.1, from TER
Typo3 10.4.6
Language - Strict, Connected mode

Add a default "showitem" configuration

It would be nice to add a default container showitem configuration for container elements that do not provide a more expansive showitem configuration.

When registering a new container this "showitem" TCA configuration could be added; as long as there is no special configuration set up following the registration of the container this default setup will be used. It would make sense to add default fields (like CType, language, access) to a default configuration so the container is working in most instances.

Localize Container with Copy-Mode

Localize a container in Copy-Mode (copyToLanguage) should also localize the children in Copy-Mode and remap the tx_container_parent field

Currently the children are not localized.

Reorder parameters for registerContainer

The order of the parameter for registering a new CType could be changed to move the icon to a position after the grid configuration so a minimum configuration can consist of CType, label, description, and grid.

public function registerContainer(
        string $cType,
        string $label,
        string $description,
        array $grid = [],
        string $backendTemplate = 'EXT:container/Resources/Private/Templates/Container.html',
        string $gridTemplate = 'EXT:container/Resources/Private/Templates/Grid.html',
        string $icon = 'EXT:container/Resources/Public/Icons/Extension.svg',
        bool $registerInNewContentElementWizard = true
    ): void

Use saveAndClose for new content element wizard on "simple" container items

It would be nice to make use of the new "saveAndClose" setting for the new content element wizard in v10 on automatic container registration.

As long as there are no additional, custom "showitems" settings it can be assumed that the container is only used as a means to create content areas to add child elements. In this case, the "saveAndClose" setting could be set to "true" by default.

see also: #23

[BUG] Previewing in workspaces: Staged Versions is always empty

Hi ๐Ÿ‘‹

I am currently testing container with workspaces and it seems like that previewing in the FE is not working as expected. The Staged Version is always empty when debugging renderedContent so nothing is showing in the FE.

This PR #88 removed these line in Classes/DataProcessing/ContainerProcessor.php and might be the cause of the bug:

if ($child['t3ver_oid'] > 0) {
    $conf['source'] = $child['t3ver_oid'];
} else {
    $conf['source'] = $child['uid'];
}

Manually re-adding these line back seems to work and previewing work as expected.

Specs:

  • TYPO3 10 latest running in composer mode + PHP 7.4 using ddev
  • container dev-master

Fatal error after adding Container in v9

Error:
In the backend (page module) I got a error message after adding a container and saving it.

Fatal error: Access level to B13\Container\View\ContainerLayoutView::$nextThree must be public (as in class TYPO3\CMS\Backend\View\PageLayoutView) in /var/www/html/public/typo3conf/ext/container/Classes/View/ContainerLayoutView.php on line 0

Steps to reproduce:

  • use TYPO3-Version: 9.5.19
  • add following in Configuration/TCA/Overrides/tt_content.php
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\B13\Container\Tca\Registry::class)->addContainer(
    '2col-container', 
    '2 Column Container',
    'Insert an element dividing the content area into two columns',
    [
        [
            ['name' => 'Left Column', 'colPos' => 201],
            ['name' => 'Right Column', 'colPos' => 202]
        ]
    ] 
  • add this container in the backend & save
  • see error

Screenshot:
grafik

Custom opt group in CType

It would be nice to have a custom optgroup in field CType for all container elements. See screenshot how it looks like currently

grafik

Strange Behaviour in Datahandler when localize multiple containers with one cmdmap

depending on ordering of the containers in the command, or the children in the container results in wrong relations to tx_container_parent (localze and copyToLanguage has same bug)

this happens because of the fixCopyAfterDuplFields() Method which fetch diffent prevData

I think we can drop the $GLOBALS['TCA']['tt_content']['ctrl']['copyAfterDuplFields'] .= ',tx_container_parent'; Configuration, this solves the Bug. The Configuration was introduce at the beginning of the project at seems to be obsolete (all Tests runs still fine.)

Workspace Imrovements

  • move a child between containers works not as expected, the tx_container_parent of the live-Record-Child changed also (and so the change is direkt live).
  • fix the tx_container_parent on live-Record-Child leeds to wrong rendering in WS, the WS-Record-Child is rendered in the original container.
  • (publishing after fixing the tx_container_parent on live-Record-Child works)

[IMPROVMENT]: Make children-cols in frontend FLUIDTEMPLATE traversable

Hi,

right now, the B13\Container\DataProcessing\ContainerProcessor delivers 1-n "top-level" variables into the Fluid-Template (for example {children_101}, {children_102} etc.). This makes it hard to iterate over these columns to avoid repeating HTML-wrapping-markup. A fluidtemplate-variable like {containerColumns} that contains all the identified {children_*} elements would be nice.

Example for a traversable containerColumns variable in FLUIDTEMPLATE:
`




<f:for each="{containerColumns}" as="child">


<f:format.raw>
{child.0.renderedContent}
</f:format.raw>


</f:for>

`

Use a Configuration Object for Container-Registration

wanna get rid of too much Parameters on

public function addContainer(
        string $cType,
        string $label,
        string $description,
        array $grid,
        string $icon = 'EXT:container/Resources/Public/Icons/Extension.svg',
        string $backendTemplate = 'EXT:container/Resources/Private/Templates/Container.html',
        string $gridTemplate = 'EXT:container/Resources/Private/Templates/Grid.html',
        bool $saveAndCloseInNewContentElementWizard = true,
        bool $registerInNewContentElementWizard = true
    )

so changing last parameter will not required all other parameters override ...

Minimize required typoscript configuration

I would like to see a way to minimize the TypoScript configuration required, and assign the content for each colPos to a variable for Fluid automatically. This way a smaller TypoScript setup like this

tt_content.2col-container =< lib.contentElement
tt_content.2col-container {
  templateName = 2col-container
  dataProcessing.13 = B13\Container\DataProcessing\ContainerProcessor
}

could achieve the same result as this snippet:

tt_content.2col-container =< lib.contentElement
tt_content.2col-container {
  templateName = 2col-container
  dataProcessing {
    201 = B13\Container\DataProcessing\ContainerProcessor
    201 {
      colPos = 201
      as = children_201
    }
    202 = B13\Container\DataProcessing\ContainerProcessor
    202 {
      colPos = 201
      as = children_202
    }
}

by automatically assigning every available column to a default variable name.

Default labels for containers

Since default icons are now shipped (thx for that!) it would be great to have labels for those containers as well. Some possible labels:

  • Container with {2,3,4} columsn
  • Left|Center|Right
  • ...

Problems with drag'n'drop

Since I have installed EXT:container, it is no more possible to drag content elements. No matter whether the elements are in- or outside a container element.

The log says:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Argument 2 passed to B13\Container\Hooks\Datahandler\CommandMapPostProcessingHook::copyOrMoveChildren() must be of the type integer, string given, called in /public/typo3conf/ext/container/Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php on line 49 | TypeError thrown in file /public/typo3conf/ext/container/Classes/Hooks/Datahandler/CommandMapPostProcessingHook.php in line 87. Requested URL: .../typo3/index.php?route=%%2Fajax%%2Frecord%%2Fprocess&token=--AnonymizedToken--&cmd[tt_content][29][move]=1&data[tt_content][29][colPos]=8-10&data[tt_content][29][sys_language_uid]=0

Otherwise I like the extension very much, good job, thanks!
Tobi

[BUG] Moving records in workspaces

Hi ๐Ÿ‘‹
while testing container with workspaces i might found a bug when moving records.

Tested scenario:

  • Creating new CE in workspaces and moving them to check if it's working in BE & FE โœ…
  • Creating new container CE and move others CE inside & check if it's working in BE & FE โœ…
  • Creating new CE inside container and moving them & check if it's working in BE & FE โœ…
  • Moving CE which were outside & not created inside of container CE & check if it's working in BE & FE โŒ

The last scenario failed.

Specs:

  • TYPO3 10 latest running in composer mode + PHP 7.4 using ddev
  • container dev-master

I haven't found a solution yet and am still debugging, will report back when finding more.

Creating CE 38,39 in workspaces

uid pid sorting t3_origuid t3ver_oid t3ver_state t3ver_count t3ver_tstamp t3ver_count t3ver_move_id colPos tx_container_parent
38 1 64 0 0 0 0 0 0 0 0 0
39 1 128 0 0 0 0 0 0 0 0 0

After moving CE uid 39 above 38

uid pid sorting t3_origuid t3_origuid t3ver_oid t3ver_state t3ver_count t3ver_tstamp t3ver_count t3ver_move_id colPos tx_container_parent
38 1 64 0 0 0 0 0 0 0 0 0 0
39 1 128 0 0 0 0 0 0 0 0 0 0
40 1 128 39 39 39 4 0 0 0 0 0 0
41 1 32 0 0 0 3 0 0 0 39 0 0

After creating container CE (uid=42) and moving uid 38,39 in colPos 101

uid pid sorting t3_origuid t3_origuid t3ver_oid t3ver_state t3ver_count t3ver_tstamp t3ver_count t3ver_move_id colPos tx_container_parent
38 1 64 0 0 0 0 0 0 0 0 0 0
39 1 128 0 0 0 0 0 0 0 0 0 0
40 1 128 39 39 39 4 0 0 0 0 101 42
41 1 32 0 0 0 3 0 0 0 39 101 42
42 1 96 0 0 0 1 0 0 0 0 0 0
43 1 96 0 0 42 -1 0 0 0 0 0 0
44 1 64 38 38 38 0 0 0 0 0 101 42

After moving uid 39 above 38 in container CE same colPos but the sorting won't change

uid pid sorting t3_origuid t3_origuid t3ver_oid t3ver_state t3ver_count t3ver_tstamp t3ver_count t3ver_move_id colPos tx_container_parent
38 1 64 0 0 0 0 0 0 0 0 0 0
39 1 128 0 0 0 0 0 0 0 0 0 0
40 1 128 39 39 39 4 0 0 0 0 101 42
41 1 32 0 0 0 3 0 0 0 39 101 42
42 1 96 0 0 0 1 0 0 0 0 0 0
43 1 96 0 0 42 -1 0 0 0 0 0 0
44 1 64 38 38 38 0 0 0 0 0 101 42

Final tables

uid pid sorting t3_origuid t3_origuid t3ver_oid t3ver_state t3ver_count t3ver_tstamp t3ver_count t3ver_move_id colPos tx_container_parent
38 1 64 0 0 0 0 0 0 0 0 0 0
39 1 128 0 0 0 0 0 0 0 0 0 0
40 1 128 39 39 39 4 0 0 0 0 101 42
41 1 0 0 0 0 3 0 0 0 39 101 42
42 1 96 0 0 0 1 0 0 0 0 0 0
43 1 96 0 0 42 -1 0 0 0 0 0 0
44 1 64 38 38 38 0 0 0 0 0 101 42
45 1 1 0 0 0 1 0 0 0 0 102 42
46 1 1 0 0 45 -1 0 0 0 0 102 42
47 1 2 0 0 0 1 0 0 0 0 102 42
48 1 2 0 0 47 -1 0 0 0 0 102 42

Using the same colPos with different names not possible

I want to use two container elements: A two column container and a three column container.
Using containers with colPos values 201 and 202 for the two column container, and 201, 202, and 203 for the three columns containers seems to make the most sense since editors can use the containers and switch between the different configurations without having to rearrange all content elements already saved into one of the first two columns.

If I set names like 201 => left, 202 => right for the two column container, and 201 => left, 202 => middle, 203 => right for the three column container one of the following is happening:
Either the two column element has column names in the backend of "left" and "middle" (instead of "left" and "right"), or the three column element has column names of "left", "right" and "right".

I can fix this by applying pageTSconfig or using columnsOverride configuration (not tested) but it would make more sense to have that solved on registering a container cType.

Generalize DataProcessor

we can simplify TS DataProcessor usage by autom. add 'children_' Variable to processedData if not explicite defined

Error if copy/paste container grid with elements in combination with content_defender

My first TYPO3 10 with the Container Extension - what a cool extension, great work!
but i have one issue.

I don't know if it is a bug in content_defender or in the container extension. I will try it here.
In the BackendLayout of the page template a allowed list is defined:

mod {
  web_layout {
    BackendLayouts {
      default {
        title = Default
        config {
          backend_layout {
            colCount = 1
            rowCount = 1
            rows {
              1 {
                columns {
                  1 {
                    name = Main Content
                    colPos = 0
                    allowed {
                      CType = list, shortcut, div, uploads, shortcut, html, gridcol1left
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

On the page I add a container grid element (gridcol1left).
In the container element I add a text element.
So far everything works fine.
But if I copy and paste the container element, the following two error messages appear:

The record "Text" couldn't be saved due to disallowed value(s).
Attempt to insert record on page '[root-level]' (0) where this table, tt_content, is not allowed.

It looks like trying to copy the text element directly into the page template, which is not allowed.

If i remove the allowed Ctype list in the BackendLayout, everything works fine.

Setup:
TYPO3 10.4.7
Container 1.1.1
contend_defender: 3.1.0

Error with Access level

Using the new version 1.1. I get the following error in the backend

Fatal error: Access level to B13\Container\View\ContainerLayoutView::$nextThree must be public (as in class TYPO3\CMS\Backend\View\PageLayoutView) in /xxx/xxxx/rp-hosting/xxx/xxx/typo3cms/projekt1/typo3conf/ext/container/Classes/View/ContainerLayoutView.php on line 309

TYPO3 9.5.19

Inconsistent preview icons

The icons are a bit incosistent regarding the background color.

The icons container-2col-right and container-3col are using a transparent background, the others are using white

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.