The displayIcon Macro
Last modified by Eleni Cojocariu on 2026/08/25 16:43
Reference
Description
The displayIcon Macro displays one icon of the Icon Theme in the content of a page. In the macro list of the editors it appears as "Icon".
The macro is inline: the icon can sit inside a sentence, inside a heading, or inside the label of a link.
Usage
Name the icon in the name parameter; every other parameter is optional.
The names come from the XWiki Icon Set, the set of names every Icon Theme maps to an image or to a font character. The Icon List shows all of them.
Parameters
| Name | Optional | Allowed values | Default value | Description |
|---|---|---|---|---|
| name | no | a name of the XWiki Icon Set | The icon to display. Nothing is displayed for a name the Icon Theme does not map. | |
| iconSet | yes | the name of an Icon Theme, or default | the Icon Theme configured for the wiki | The Icon Theme to take the icon from. The parameter keeps "icon set", the historical name of an Icon Theme. The value default selects the Icon Theme XWiki falls back to. |
| fallback | yes | true or false | true | Whether the icon is taken from the default Icon Theme when the chosen theme does not define it, does not exist, or has a page the reader cannot view. With false, nothing is displayed in the first two cases and the macro reports an error in the third. |
Examples
Displaying an Icon in a Sentence
The {{displayIcon name="home"/}} icon links to the wiki home page.![]()
Taking the Icon from Another Icon Theme
The {{displayIcon name="home" iconSet="Silk"/}} icon comes from the Silk Icon Theme.![]()
FAQ
Why is nothing displayed where the macro is written?
The name is not one the Icon Theme maps, and not one of the default theme either: the macro then displays nothing rather than reporting an error. Check its spelling against the XWiki Icon Set.