Giter Club home page Giter Club logo

container's People

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

container's Issues

[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

[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

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

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

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

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

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?

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

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

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 = '')

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

Provide .gitattributes

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

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.)

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 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.

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

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

[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>

`

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

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.

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

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

Generalize DataProcessor

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

[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

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.

[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

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 ...

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

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

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)

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

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.

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)

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.