|
| 1 | +(classic-ui-icons-label)= |
| 2 | + |
1 | 3 | # Icons in Plone 6 Classic UI |
2 | 4 |
|
3 | | -- Bootstrap Icons |
4 | | -- SVG Inline Icons |
| 5 | +This sections describes how to work with icons in Plone 6 Classic UI. |
| 6 | +Examples include the following. |
| 7 | + |
| 8 | +- Bootstrap icons |
| 9 | +- SVG inline icons |
5 | 10 | - Iconresolver |
6 | 11 |
|
| 12 | + |
| 13 | +(classic-ui-icons-bootstrap-label)= |
| 14 | + |
7 | 15 | ## Bootstrap Icons |
8 | 16 |
|
9 | | -Bootstrap is the default CSS Framework in Plone 6. |
10 | | -We decided to use it's icons as well. |
11 | | -Check out all available Icons at [icons.getbootstrap.com](https://icons.getbootstrap.com/). |
| 17 | +Twitter Bootstrap 5 is the default CSS framework in Plone 6. |
| 18 | +Plone uses its icons. |
| 19 | +Check out all the available Bootstrap icons at [icons.getbootstrap.com](https://icons.getbootstrap.com/). |
12 | 20 |
|
13 | | -Icons are shipped via plone.staticresources. |
14 | | -Check out the [package.json](https://github.com/plone/plone.staticresources/blob/master/package.json) of the package to get the actual version of the icons in Plone. |
| 21 | +Icons are shipped via `plone.staticresources`. |
| 22 | +See the file [package.json](https://github.com/plone/plone.staticresources/blob/master/package.json) of the package to get the actual version of the icons in Plone. |
| 23 | + |
| 24 | + |
| 25 | +(classic-ui-icons-registration-label)= |
15 | 26 |
|
16 | 27 | ## Registration |
17 | 28 |
|
18 | | -- Icons are registered in Plone's registry |
19 | | -- Registrered to override of icons via xml |
20 | | -- Option to customize UI and contenttype icons |
21 | | -- [Bootstrap Icons](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_bootstrap.xml) |
22 | | -- [Contenttypes](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_contenttype.xml) |
| 29 | +Icons are registered in Plone's registry. |
| 30 | +This provides an option to customize the contenttype and Plone UI icons by overriding icons via XML. |
| 31 | + |
| 32 | +- [Bootstrap icons](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_bootstrap.xml) |
| 33 | +- [contenttypes](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_contenttype.xml) |
23 | 34 | - [Plone UI](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_plone.xml) |
24 | 35 |
|
| 36 | + |
| 37 | +(classic-ui-icons-registration-label)= |
| 38 | + |
25 | 39 | ## Contextual Icons |
26 | 40 |
|
27 | | -We definde contextual icons. If you don't like e.g. the share icon - override it without touching the share icon used by the system. |
| 41 | +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. |
| 42 | +To use a different icon than the system default, you would override it without touching the system icon. |
| 43 | + |
| 44 | +You should avoid replacing system icons because it may result in an inconsistent user interface. |
| 45 | + |
| 46 | +The specific icon name is based on the usage in the system. |
| 47 | +For example the copy icon is named `plone.icon.plone-copy`. |
28 | 48 |
|
29 | | -- Icons like copy, cut, paste |
30 | | -- Identical function all over the site |
31 | | -- That's why we reuse those icons |
32 | | -- Specific icon name is based on the usage in the system |
| 49 | + |
| 50 | +(classic-ui-icons-icon-expression-label)= |
33 | 51 |
|
34 | 52 | ## Icon expression |
35 | 53 |
|
36 | | -- `icon_expression` field is used again to define icons (e.g. for actions, contenttypes) |
37 | | -- Use icon name for icon expressions |
| 54 | +- The field `icon_expression` is used again to define icons for actions, contenttypes, and other purposes. |
| 55 | +- Use the icon name for icon expressions. |
| 56 | + |
| 57 | + |
| 58 | +(classic-ui-icons-customization-label)= |
38 | 59 |
|
39 | 60 | ## Customization |
40 | 61 |
|
| 62 | +```{todo} |
| 63 | +Add content for this section |
| 64 | +``` |
| 65 | + |
41 | 66 | - Add custom icons |
42 | 67 | - Override some of the icons |
43 | | -- TODO |
44 | 68 |
|
45 | | -## Icon Font |
46 | 69 |
|
47 | | -- Setup profile to install icon font |
48 | | -- Usage as known from e.g. Font Awesome |
49 | | -- TODO |
| 70 | +(classic-ui-icons-icon-font-label)= |
| 71 | + |
| 72 | +## Icon font |
| 73 | + |
| 74 | +```{todo} |
| 75 | +Add content for this section |
| 76 | +``` |
| 77 | + |
| 78 | +- Set up a profile to install the icon font. |
| 79 | +- Use Font Awesome as an example. |
| 80 | + |
| 81 | + |
| 82 | +(classic-ui-icons-iconresolver-label)= |
50 | 83 |
|
51 | 84 | ## Iconresolver |
52 | 85 |
|
| 86 | +```{todo} |
| 87 | +What is `iconresolver`? |
| 88 | +Add to Glossary. |
| 89 | +``` |
| 90 | + |
| 91 | + |
| 92 | +(classic-ui-icons-iconresolver-get-icon-url-label)= |
| 93 | + |
53 | 94 | ### Get Icon URL |
54 | 95 |
|
55 | | -URL method of @@icons view returns the actual URL to the SVG icon. This can be used e.g. in an img tag. |
| 96 | +URL method of `@@icons` view returns the actual URL to the SVG icon. |
| 97 | +This can be used in an HTML `img` tag, for example. |
56 | 98 |
|
57 | | -```HTML |
| 99 | +```xml |
58 | 100 | <img src="" tal:attributes="src python:icons.url('alarm')" class="custom-class" alt="foo" /> |
59 | 101 | ``` |
60 | 102 |
|
| 103 | + |
| 104 | +(classic-ui-icons-iconresolver-get-icon-tag-label)= |
| 105 | + |
61 | 106 | ### Get Icon Tag |
62 | 107 |
|
63 | | -Tag method is used with `tal:replace` and returns an entire inline SVG image. |
| 108 | +The tag method is used with `tal:replace`. |
| 109 | +It returns an SVG image. |
64 | 110 | Inline icons can be styled via CSS. |
65 | | -`tag_class` and `tag_alt` is used to pass in custom classes and an alt text. |
| 111 | +`tag_class` and `tag_alt` is used to pass in custom classes and an `alt` text. |
66 | 112 |
|
67 | | -```HTML |
| 113 | +```xml |
68 | 114 | <tal:icon tal:replace="structure python:icons.tag('archive', tag_class='custom-class', tag_alt='foobar')" /> |
69 | 115 | ``` |
70 | 116 |
|
| 117 | +(classic-ui-icons-iconresolver-resource-path-label)= |
| 118 | + |
71 | 119 | ### Resource Path |
72 | 120 |
|
73 | | -SVG Files are avaiblae as resource: `++plone++bootstrap-icons/lightning.svg` |
| 121 | +SVG files are available from the resource path. |
| 122 | +For example, the lightning icon's resource path is `++plone++bootstrap-icons/lightning.svg`. |
| 123 | + |
| 124 | + |
| 125 | +(classic-ui-icons-iconresolver-fallback-label)= |
74 | 126 |
|
75 | 127 | ### Fallback |
76 | 128 |
|
77 | | -- There is a Plone icon defined as fallback if icon name is not found |
78 | | -- There are fallback groups e.g. for [mimetype icons](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_mimetype.xml) |
79 | | -- JPEG icon is e.g. `mimetype-image/jpeg` |
80 | | -- You can register specific icons |
81 | | -- If there is no specific icon mimetype-image is used as fallback |
| 129 | +There is a Plone icon defined as `fallback` if the name of the icon cannot be found in the registry. |
| 130 | + |
| 131 | +Fallbacks are grouped, such as [`mimetype icons`](https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/icons_mimetype.xml). |
| 132 | + |
| 133 | +For example, the JPEG icon is in this group and is in the mimetype group and is named `mimetype-image/jpeg`. |
| 134 | +You can also register specific image icons. |
| 135 | +If there is no specific icon in that group, then `mimetype-image` is used as the fallback. |
0 commit comments