Open ausi opened 9 years ago
I'd like to see this, too 👍
this would be perfect for usability. 👍
I have written a small local bundle which does the job. The configuration is done in the config file of the custom element by just adding wrapperClose
:
... 'wrapper' => array('type' => 'start'), 'wrapperClose' => 'rsce_wrapper_stop', ...
It would be nice, if the feature could be integrated into the next version.
I have written a small local bundle which does the job. The configuration is done in the config file of the custom element by just adding
wrapperClose
:
... 'wrapper' => array('type' => 'start'), 'wrapperClose' => 'rsce_wrapper_stop', ...
It would be nice, if the feature could be integrated into the next version.
How can I use it in the managed version of contao?
I've updated the file. Now it contains the ContaoManagerPlugin.php to register the local bundle and also creates the closing wrapper when copying a single start wrapper. Just extract the zip file into your contao root folder and add the following lines to your composer.json file:
"autoload": {
"classmap": [
"app/ContaoManagerPlugin.php"
],
"psr-4": {
"iq2\\CEAutoWrapperCloseBundle\\": "src/iq2/CEAutoWrapperCloseBundle/"
}
}
Hey @mariaj do I need to add something? I testet the v2 in a managed contao and the wrapper_end won't be added automatically. I already cleared all caches and reloaded the composer class loader.
My start-element:
<?php
return [
'label' => [ 'Hervorhebung mit Hintergrundbild Anfang', ''],
'types' => ['content'],
'contentCategory' => 'Gruppierung',
'standardFields' => ['cssID'],
'wrapper' => [
'type' => 'start'
],
'fields' => [...]
]
My end-element:
<?php
return [
'label' => [ 'Hervorhebung mit Hintergrundbild Ende', ''],
'types' => ['content'],
'contentCategory' => 'Gruppierung',
'standardFields' => ['cssID'],
'wrapper' => [
'type' => 'close'
]
];
Hello mj1985, you have to add the wrapperClose setting to your start-element config file to link the two elements. If the name of the end-element is 'rsce_wrapper_end', it should look like this:
<?php
return [
'label' => [ 'Hervorhebung mit Hintergrundbild Anfang', ''],
'types' => ['content'],
'contentCategory' => 'Gruppierung',
'standardFields' => ['cssID'],
'wrapper' => [
'type' => 'start'
],
'wrapperClose' => 'rsce_wrapper_end',
'fields' => [...]
]
hope I could help :)
I also have a new version, where I updated the calcuation of the sorting field:
AutoWrapperClose_v2.1.zip
Additional Information: To create a permanent link between the elements, you can look at this: https://community.contao.org/de/showthread.php?74808-Variable-aus-Wrapper-Start-in-Wrapper-Stop-verwenden&p=513862&viewfull=1#post513862 In this example, you can automatically change the data of the end-element dependent on the data of the start-element.
Is there any support for the new logic in Contao 5 for nested content elements planed? That would be great.
Is there any support for the new logic in Contao 5 for nested content elements planed? That would be great.
@jankout This is unrelated to this issue and also a duplicate of #171
If possible.