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
This sections describes how to work with icons in Plone 6 Classic UI.
14
14
Examples include the following.
@@ -35,99 +35,112 @@ See the file [package.json](https://github.com/plone/plone.staticresources/blob/
35
35
## Registration
36
36
37
37
Icons are registered in Plone's registry.
38
-
This provides an option to customize the contenttype and Plone UI icons by overriding icons via XML.
38
+
This provides an option to customize the contenttype and Plone UI icons by overriding icons via XML. Plone ships with the following icon registrations by default.
The icons above are made available as plone resources.
49
+
For example, the lightning icon's resource path is `++plone++bootstrap-icons/lightning.svg`. One could register another icon set under a new name, for example `++plone++fontawesome-icons` and override the registrations above to use them.
43
50
44
51
45
52
(classic-ui-icons-contextual-icons-label)=
46
53
47
54
## Contextual Icons
48
55
49
-
We can define contextual icons to be used in specific places in a website while preserving the default system icons to be used elsewhere throughout the site.
50
-
To use a different icon than the system default, you would override it without touching the system icon.
51
-
52
-
You should avoid replacing system icons because it may result in an inconsistent user interface.
53
-
54
-
The specific icon name is based on the usage in the system.
55
-
For example the copy icon is named `plone.icon.plone-copy`.
56
+
Plone defines contextual icons, which are used in specific places in a website.
57
+
For example we have an icon registered under the name `plone.icon.plone-copy` in https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_plone.xml which points to the bootstrap clipboard-plus icon `++plone++bootstrap-icons/clipboard-plus.svg`.
58
+
To use a different icon than the system default, you can override the registration for `plone.icon.plone-copy` with another icon path.
56
59
57
60
58
61
(classic-ui-icons-icon-expression-label)=
59
62
60
63
## Icon expression
61
64
65
+
```{note}
66
+
How does this work? We need an example here!
67
+
```
68
+
62
69
- The field `icon_expression` is used again to define icons for actions, contenttypes, and other purposes.
63
70
- Use the icon name for icon expressions.
64
71
65
72
66
-
(classic-ui-icons-customization-label)=
67
-
68
-
## Customization
69
-
70
-
```{todo}
71
-
Add content for this section
72
-
```
73
-
74
-
- Add custom icons
75
-
- Override some of the icons
76
-
73
+
(classic-ui-icons-iconresolver-label)=
77
74
78
-
(classic-ui-icons-icon-font-label)=
75
+
## Iconresolver
79
76
80
-
## Icon font
77
+
The iconresolver take's an icon name (without the `plone.icon.` prefix) like `plone-copy` or `align-center` and resolves it to an actual icon.
URL method of `@@icons` view returns the actual URL to the SVG icon.
105
-
This can be used in an HTML `img` tag, for example.
94
+
The `url`method of `@@iconresolver` view returns the actual url to the SVG icon. The iconresolver view is globally available in templates under the name `icons`.
[Mockup](https://github.com/plone/mockup) provides an iconResolver function, defined in core/utils.js, which does this the same way and has a fallback for demo and testing.
126
142
127
-
### Resource Path
128
143
129
-
SVG files are available from the resource path.
130
-
For example, the lightning icon's resource path is `++plone++bootstrap-icons/lightning.svg`.
0 commit comments