You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allows you to easily manage your own CSS classes as groups provided in layouts, pages, articles, modules, news, events, forms, form elements and content elements.
8
9
9
10
This plugin is designed to simplify theme customizations without the need of manually adding classes or creating new layouts.
10
11
11
12
## Overview
12
-
- Many possibilities of use (grid, animations, content properties, ...)
13
+
- Many possibilities of use (grids, animations, content properties, ...)
13
14
- Clear representation in the backend
14
-
-Groups and Categories
15
+
-Categories and Groups
15
16
- Combine and output as tabs [](#manage-categories)
16
17
- Passing variables to the template [](#passing-style-group-variables-to-a-template)
18
+
- Formatting output using predefined methods or your own [](#passing-style-group-variables-to-a-template)
17
19
- Available for
18
20
- Layouts
19
21
- Pages
@@ -27,10 +29,6 @@ This plugin is designed to simplify theme customizations without the need of man
-`Alias`: Define an alias with which the group can be accessed. This is only required for passing on to the template.
57
56
-`Add search field`: Use of chosen for a search field within the select box
58
-
-`Use as template variable`: This field declares whether this style group is set in the class of the corresponding element or passed to the template.
57
+
-`Use as template variable`: This field declares whether this group is set in the class attribute of the corresponding element or passed to the template.
If the checkbox "Use as template variable" is set, these are not automatically passed to the class of the corresponding element but are available in the template.
67
-
68
66
To access the variables, we can access the corresponding class collection via the `styleManager` object.
69
67
68
+
#### There are two ways to receive the values:
69
+
-**get**: Return selected CSS classes of a category or a specific group
70
+
- Parameter:
71
+
- `identifier: string`: Category identifier
72
+
- `groups: null|array` (optional): Group aliases
73
+
-**prepare** + **format**: Different from the get method, you can specify your own output format and a predefined or custom method to validate the output
74
+
-`prepare`-Parameter:
75
+
- `identifier: string`: Category identifier
76
+
- `groups: null|array` (optional): Group aliases
77
+
-`format`-Parameter:
78
+
-`format: string`: The format parameter must contain a format string valid for `sprintf` (PHP: [sprintf](https://www.php.net/manual/de/function.sprintf.php))).
79
+
-`method: string` (optional): Name of Method
80
+
81
+
#### Predefined methods
82
+
-`json`: Returns a JSON object using the alias and value (e.g. `{"alias1":"my-class-1","alias2":"my-class-2"}`)
83
+
84
+
#### Register your own method per Hook
85
+
To set up a custom method for validating the values, the hook `styleManagerFormatMethod` can be registered.
86
+
87
+
<br/>
88
+
89
+
> Let us know if you know of any other useful methods that could be included in the standard 👋
90
+
70
91
#### Examples:
92
+
##### Using `get`-Method
71
93
```php
72
94
// Return of all selected CSS classes of a category
73
95
$this->styleManager->get('myCategoryIdentifier');
74
96
75
97
// Return of all selected CSS classes in specific groups of a category
0 commit comments