Skip to content

Commit

Permalink
Fix be template for open/hide legends
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Nov 29, 2024
1 parent 0a5bd15 commit 46e98d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Resources/contao/templates/dcbe_general_edit.html5
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ $GLOBALS['TL_CSS']['cca.dc-general.generalDriver'] = '/bundles/ccadcgeneral/css/

<?php foreach($this->fieldsets as $arrFieldset):
$paletteId = 'pal_' . StringUtil::specialchars($arrFieldset['legend']);
$class = $arrFieldset['class'] . (($fieldsetStates[$this->table][$paletteId] ?? null) ? '' : ' collapsed');
$class = $arrFieldset['class'];
if (null !== ($fieldsetState = ($fieldsetStates[$this->table][$paletteId] ?? null))) {
$class = \str_replace(' collapsed', '', $class);
if (0 === $fieldsetState) {
$class .= ' collapsed';
}
}
if($arrFieldset['legend'] ?? null): ?>
<fieldset id="<?= $paletteId ?>" class="<?= $class ?>" data-controller="contao--toggle-fieldset" data-contao--toggle-fieldset-id-value="pal_<?= StringUtil::specialchars($arrFieldset['legend']) ?>" data-contao--toggle-fieldset-table-value="<?= StringUtil::specialchars($this->table) ?>" data-contao--toggle-fieldset-collapsed-class="collapsed" data-contao--jump-targets-target="section" data-contao--jump-targets-label-value="<?= $arrFieldset['label'] ?>" data-action="contao--jump-targets:scrollto->contao--toggle-fieldset#open">
<legend><button type="button" data-action="contao--toggle-fieldset#toggle" aria-expanded="true"><?= $arrFieldset['label'] ?></button></legend>
Expand Down

0 comments on commit 46e98d4

Please sign in to comment.