oveleon / contao-component-style-manager

This extension is for the Contao CMS and allows you to easily manage and provide custom categories and groups for CSS classes.
MIT License
23 stars 6 forks source link

Display archive group title above StyleManager widget #76

Closed zoglo closed 1 year ago

zoglo commented 1 year ago

This PR introduces displayal of the archive group title above the Style-Manager groups within the backend and should enhance the UX and UI.

image

redwise commented 1 year ago

Excellent, we love this tool

zoglo commented 1 year ago

I added another feature that I like to have implemented with this PR:

Exclusion of groups within get and prepare methods

Usage

Methods:

public function get($identifier, $arrGroups=null, $excludedGroups=null)

  1. $this->styleManager->get('archive', ['group1', 'group2'], ['group1']) will only return 'group2'
  2. $this->styleManager->get('archive' null, ['group1']) will return everything but 'group1'

public function prepare($identifier, $arrGroups=null, $excludedGroups=null): Styles

  1. $this->styleManager->prepare('archive', ['group1','group2'], ['group1'])->format('%s) will only return 'group2'
  2. $this->styleManager->prepare('archive' null, ['group1'])->format('%s) will return everything but 'group1'

Everything else is unaffected. If you do not parse excluded groups, they won't get removed.

doishub commented 1 year ago

if no group title is given, it won't be displayed if a group title is given, it will be shown above it

I am unsure if this rule should be fixed here. What if I want to merge individual groups (tabs) but not output a headline? I think another checkbox within the group should be added as well.

However, I am not sure if this will work out as within each group this checkbox would need to be included. What if we make the headline on/off via config.yaml?

doishub commented 1 year ago

Thank you @zoglo!