Skip to content

Commit

Permalink
Ensure that alias field is only added to folder pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolineus committed Oct 8, 2024
1 parent 8261c33 commit 9732085
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/EventListener/Dca/Page/PaletteListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ public function __invoke(): void
PaletteManipulator::POSITION_APPEND,
);

$pageManipulator = PaletteManipulator::create()->addField(
['bbit_turl_inherit', 'bbit_turl_transparent', 'bbit_turl_ignoreRoot'],
'routing_legend',
PaletteManipulator::POSITION_APPEND,
);

foreach ($GLOBALS['TL_DCA']['tl_page']['palettes'] as $selector => $palette) {
if ($selector === '__selector__' || ! is_string($palette)) {
continue;
Expand All @@ -37,6 +31,12 @@ public function __invoke(): void
continue;
}

$pageManipulator = PaletteManipulator::create()->addField(
['bbit_turl_inherit', 'bbit_turl_transparent', 'bbit_turl_ignoreRoot'],
'routing_legend',
PaletteManipulator::POSITION_APPEND,
);

if ($selector === 'folder') {
$pageManipulator->addLegend('routing_legend', 'title_legend');
$pageManipulator->addField('alias', 'routing_legend', PaletteManipulator::POSITION_PREPEND);
Expand Down

0 comments on commit 9732085

Please sign in to comment.