mvo / contao-group-widget
Adds a new group widget that allows repeating a set of DCA fields.
Installs: 68 675
Dependents: 10
Suggesters: 1
Security: 0
Stars: 24
Watchers: 5
Forks: 9
Open Issues: 13
Type:contao-bundle
Requires
- php: >=7.4
- contao/core-bundle: ^4.9 || ^5.0
- doctrine/collections: ^1.4 || ^2.1
- doctrine/dbal: ^2.12 || ^3.0
- doctrine/inflector: ^1.4 || ^2.0
- doctrine/orm: ^2.6
- psr/container: ^1.0 || ^2.0
- symfony/config: ^4.4 || ^5.0 || ^6.0
- symfony/dependency-injection: ^4.4 || ^5.0 || ^6.0
- symfony/http-foundation: ^4.4 || ^5.0 || ^6.0
- symfony/http-kernel: ^4.4 || ^5.0 || ^6.0
- symfony/property-access: ^4.4 || ^5.0 || ^6.0
- twig/twig: ^2.7 || ^3.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- contao/manager-plugin: ^2.0
- phpunit/phpunit: ^9.5
- symfony/cache: ^5.4
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
- dev-main
- v1.5.9
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- V1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- v1.0.0-RC2
- v1.0.0-RC
- v1.0.0-beta4
- v1.0.0-beta3
- v1.0.0-beta2
- v1.0.0-beta1
- v0.3
- v0.2.1
- v0.2
- v0.1
- dev-bugfix/entity-without-element-position
- dev-zero-index
- dev-feature/support-file-dcs
This package is auto-updated.
Last update: 2024-11-01 11:00:47 UTC
README
This Contao CMS extension provides an input type group
that allows
repeatable groups of fields in the backend. The resulting data is either
stored as a serialized array or in a custom entity relationship (ORM).
Design decisions / Limitations
The group element widgets are still 'first class citizens' of the respective DCA. Only their definition will be made on the fly. This way we're not messing with the act of rendering and state of the displayed child widgets. As a result, adding new elements via the plus button will submit the current DCA form to add the new element.
Visual reordering of elements is done via the CSS order
property. This way
iframes
can be kept alive (the DOM won't change) which is especially helpful
when dealing with components like the tinyMCE
rich text editor.
Documentation
- Data definition
- Storage backends
- Serialized storage (default)
- Entity storage
- Extending
TLDR;
Just give me an example, ok?
$GLOBALS['TL_DCA']['tl_content']['fields']['my_group'] = [ 'inputType' => 'group', 'palette' => ['amount', 'singleSRC', 'text'], 'fields' => [ 'amount' => [ // additional field, defined inline 'inputType' => 'text', 'eval' => ['tl_class' => 'w50'], ], '&singleSRC' => [ // let's change some properties of the existing field 'eval' => ['mandatory' => false], ] ], // force at least 1, at max 5 elements 'min' => 1, 'max' => 5, // disable ordering (on by default) 'order' => false, // store serialized into a blob (default storage backend) 'sql' => [ 'type' => 'blob', 'length' => \Doctrine\DBAL\Platforms\MySQLPlatform::LENGTH_LIMIT_BLOB, 'notnull' => false, ], ];