Skip to content

3.8.0

Compare
Choose a tag to compare
@zoglo zoglo released this 07 May 11:58
· 9 commits to main since this release

Bugfix

Addition

  • Added a AddStyleManagerPaletteEvent with skipPalette to not render the StyleManager Widget at all

Example:

<?php

namespace App\EventListener;

use Oveleon\ContaoComponentStyleManager\Event\AddStyleManagerPaletteEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
use Symfony\Contracts\EventDispatcher\Event;

#[AsEventListener(AddStyleManagerPaletteEvent::class)]
class AddStyleManagerPaletteEventListener extends Event
{
    public function __invoke(AddStyleManagerPaletteEvent $event): void
    {
        $table = $event->dc->table;
        $palette = $event->palette;

        if (
            'tl_module' === $table && in_array($palette, ['root_page_dependent_modules', 'unfiltered_html', 'html'])
            || 'tl_content' === $table && in_array($palette, ['unfiltered_html', 'html', 'accordionStop', 'sliderStop'])
            || 'tl_form_field' === $table && in_array($palette, ['html', 'fieldsetStop', 'hidden', 'hiddencustom'])
        ) {
            $event->skipPalette();
        }
    }
}

Full Changelog: 3.7.4...3.8.0