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
The icons above are made available as Plone resources.
50
-
For example, the icon registered as `lightning` (in XML with prefix full name is `plone.icon.lighting`) resource path is `++plone++bootstrap-icons/lightning.svg`.
50
+
For example, the icon registered as `lightning` has the resource path of `++plone++bootstrap-icons/lightning.svg`.
51
+
In XML, with its prefix, its full name is `plone.icon.lighting`.
51
52
One could register another icon set under a new name, for example `++plone++fontawesome-icons`, and override the registrations above to use them.
52
53
53
54
54
55
(classic-ui-icons-contextual-icons-label)=
55
56
56
57
## Contextual Icons
57
58
58
-
Plone defines contextual icons, which are used in specific places in a website.
59
-
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`.
59
+
Plone defines contextual icons which are used in specific places in a website.
60
+
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`.
61
+
It points to the bootstrap `clipboard-plus` icon `++plone++bootstrap-icons/clipboard-plus.svg`.
60
62
To use a different icon than the system default, you can override the registration for `plone.icon.plone-copy` with another icon path.
61
63
62
64
@@ -68,27 +70,27 @@ To use a different icon than the system default, you can override the registrati
68
70
How does this work? We need an example here!
69
71
```
70
72
71
-
- The field `icon_expression` is used again to define icons for actions, contenttypes, and other purposes.
73
+
- The field `icon_expression` is used again to define icons for actions, content types, and other purposes.
72
74
- Use the icon name for icon expressions.
73
75
74
76
75
-
(classic-ui-icons-iconresolver-label)=
77
+
(classic-ui-icons-icon-resolver-label)=
76
78
77
-
## Iconresolver
79
+
## Icon resolver
78
80
79
-
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.
81
+
The icon resolver takes an icon's name without the `plone.icon.` prefix, such as `plone-copy` or `align-center`, and resolves it to the URL of an actual icon.
The iconresolver can be used via URL or via Python as shown in section {ref}`classic-ui-icons-iconresolver-get-icon-url-label` and {ref}`classic-ui-icons-iconresolver-get-icon-tag-label`.
88
+
The icon resolver can be used to get an icon's URL or an inline icon (or tag) via a Python expression as shown in the sections {ref}`classic-ui-icons-icon-resolver-get-icon-url-label` and {ref}`classic-ui-icons-icon-resolver-get-icon-tag-label`.
### Get inline icon (tag) in a template via traverse
123
+
124
+
### Get inline icon (tag) in a template via traversal
122
125
123
126
```xml
124
127
<tal:icontal:replace="structure icons/alarm" />
125
128
```
126
129
130
+
127
131
### Get an inline icon (tag) in JavaScript
128
132
129
133
```js
@@ -138,9 +142,9 @@ if(baseUrl){
138
142
}
139
143
```
140
144
141
-
[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.
142
-
143
-
145
+
[Mockup](https://github.com/plone/mockup) provides an `iconResolver` function, defined in `core/utils.js`
146
+
This function resolves icons the same way.
147
+
It also has a fallback for demo and testing.
144
148
145
149
146
150
(classic-ui-icons-iconresolver-fallback-label)=
@@ -151,6 +155,6 @@ There is a Plone icon defined as `fallback` if the name of the icon cannot be fo
151
155
152
156
Fallbacks are grouped, such as [`mimetype icons`](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_mimetype.xml).
153
157
154
-
For example, the JPEG icon is in this group and is in the mimetype group and is named `mimetype-image/jpeg`.
158
+
For example, the JPEG icon is in this group, as well as the mimetype group, and is named `mimetype-image/jpeg`.
155
159
You can also register specific image icons.
156
160
If there is no specific icon in that group, then `mimetype-image` is used as the fallback.
0 commit comments