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
* Init for theme settings
* Re-render element on theme setting change
* - full page theme editor
- add breadcrumbs
* adding sub-menu styles for theme-settings
* add breadcrumbs for MODX 2
* fix broken dialog boxes in elfinder
* Saving & rendering
* add theme settings model for 2.x
* Saving & Rendering in 2.x
* Save to context settings for non-global theme settings
* working on twig output for theme settings
Signed-off-by: matdave <[email protected]>
* more tweaks to theme-settings
Signed-off-by: matdave <[email protected]>
* adjusting look of fred and adding some basic documentation for theme settings
Signed-off-by: matdave <[email protected]>
* add global flag to the documentation.
Signed-off-by: matdave <[email protected]>
* add global flag to the documentation.
Signed-off-by: matdave <[email protected]>
* Remove comments
---------
Signed-off-by: matdave <[email protected]>
Co-authored-by: Jan Peca <[email protected]>
Copy file name to clipboardexpand all lines: Writerside/topics/themer/cmp/cmp_themes.md
+48-3
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,54 @@ When you create a Theme, Fred will automatically create a directory named for th
27
27
28
28
### Default Element
29
29
30
-
The default element setting allows you to chose a default Fred Element and target area for placing the content on existing documents. The setting is formatted as `ID|target` where ID is the identification number of the Fred Element and the target is the HTML object within containing a `data-fred-name` attribute. This is useful for converting a standard resource to Fred, as it will place the existing content in the default element.
31
-
32
-
If you aren't finding the identification number of the Fred Element, right-click on the top of the element grid and make sure the ID column is selected.
30
+
The default element setting allows you to choose a default Fred Element and target area for placing the content on existing documents. The setting is formatted as `UUID|target` where UUID is the universally unique identification number of the Fred Element and the target is the HTML object within containing a `data-fred-name` attribute. This is useful for converting a standard resource to Fred, as it will place the existing content in the default element.
31
+
32
+
If you aren't finding the UUID of the Fred Element, open an element and look for a display field labeled "UUID".
33
+
34
+
### Theme Settings
35
+
36
+
Themes can have settings that are used to configure the theme. These settings are stored in the "Settings" section of the Theme. The settings are stored as a JSON object and can be accessed in the theme's twig templates using the `theme_setting` object. For example, if you have a setting named `logo`, you can access it in a template like this:
37
+
38
+
```twig
39
+
<img src="{{ theme_setting.logo }}" />
40
+
```
41
+
42
+
Theme settings are saved in the system settings and can be accessed outside of fred using the theme's Setting Prefix. For example, if the theme's setting prefix is `my_theme`, you can access the setting `logo` in a chunk like this:
Theme settings can use any of the [setting types](settings.md#available-settings-types) described in the option groups documentation.
49
+
50
+
#### Format
51
+
52
+
The theme settings are formatted as a JSON array. Here is an example of a theme setting:
53
+
54
+
```json
55
+
[
56
+
{
57
+
"group": "Look and Feel",
58
+
"settings": [
59
+
{
60
+
"name": "site_color",
61
+
"type": "colorswatch",
62
+
"options": [
63
+
"lightcoral",
64
+
"red",
65
+
"black"
66
+
]
67
+
},
68
+
{
69
+
"name": "site_logo",
70
+
"type": "image"
71
+
}
72
+
]
73
+
}
74
+
]
75
+
```
76
+
77
+
One additional option that is specific to Theme Settings is that each setting can have a `"global": false` flag. This flag will cause the setting to save to the context it is used in, rather than the system settings. This is useful for multi-context sites where you want to have different settings for different contexts.
0 commit comments