iconPicker

Last modified by Lucas Charpentier on 2026/10/27 10:28

Audit

Macro ID
iconPicker
Source
XS
Type
Generator
Classification reason
The macro has no content and its output is an invisible script that applies the icon picker to the input fields that its id or class names, so most of its output comes from its parameters and the page around it, like id.
Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-20
Auditor
Compared macros
attachmentGalleryPicker displayIcon

Sources

Where to gather the information the criteria are checked against, see Gather the sources.

SourceWhat it givesUsed forWhere
DocumentationParameters, default values and examples, including the most common exampleL2, L3, and the criteria measured with the most common examplehttps://extensions.xwiki.org/xwiki/bin/view/Extension/Icon%20Theme%20Application#HIconPickerMacro
Source codeHow the macro declares its parameters and content: types, groups, features, advanced and hidden flags, constraints, content type, inline supportC4, C5, C7, C8, C9, C13, E4, E6https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-ui/src/main/resources/IconThemesCode/IconPickerMacro.xml
Macro descriptorWhat the Edit Macro dialog is built from, on design.xwiki.orgD1, D2, C1 to C9, E4Descriptor, list of macros with their categories
TranslationsThe name, description and parameter names in each languageD1, D2, D4, C1l10n.xwiki.org
Uses in XWiki pagesHow XWiki itself uses the macro, a realistic example when the documentation has noneL3, C2, C3, C6, C8, C9Search the xwiki organization on GitHub
Compared macrosThe audits of the macros of the same typeL1, D3attachmentGalleryPicker, displayIcon
Other sources specific to this macro
  • IconPickerMacro.xml: the Velocity of the wiki macro, which renders only a script and applies the picker to the id and to the class when they are not empty.
  • IconPicker.xml: the JavaScript of the picker, where the default prefix is "icon:", not the "" of the description.
  • Uses in XWiki Standard: TemplateProviderSheet and TemplateProviderEditSheet with id="XWiki.TemplateProviderClass_0_icon" prefix="" , LiveTableEditSheet with id="applicationIcon" prefix="icon:" .
CriterionResultNotes
D1 wordingOK"Icon Picker" is plain words and a user looking for an icon finds it by its name. A user who types "icon" gets it only at rank 32, after the two Icon entries of displayIcon, so no developer widget comes before the entry that does what the user searched for.
D2 summaryKO"Select an icon within the XWiki icon set." describes what the picker does once it is on a field, not what the macro adds to the page: it adds nothing visible, it only turns existing input fields into icon pickers by their id or CSS class. It also uses "icon set", the historical name of what the administration calls an Icon Theme. To reproduce: open the Insert Macro dialog and select Icon Picker.
D3 categoryOKthe macro is in the Development category, like attachmentGalleryPicker, the other picker widget that a script wires to the page. displayIcon is in a user category, where users look for the icon they want to display, which is not the use of this macro.
D4 quick-actionKOQuick Actions finds the macro first for "iconPicker", "Icon Picker" and the French name "Sélecteur d'icônes". The synonym "icon" finds it only at rank 32, after Icon, Icon, Content, Embed content, Include Page and the other entries, and "icon selector", "icon chooser", "symbol" and "glyph" give no result. The Insert Macro dialog finds "Icon Picker" and "icon set" but not the ID, which is generic, see XWIKI-20230.
L1 consistencyOKcompared with attachmentGalleryPicker and displayIcon. Like both, no parameter is mandatory, there is no content, and the Quick Action inserts the macro right away with no dialog. All three are generators with their own parameters, so the differences are by design.
L2 doc-parametersKOthe documentation is the legacy page of the Icon Theme Application on extensions.xwiki.org, not the new documentation tree. It has no parameter table: id and class are only mentioned in the text, and prefix is not documented. Its default for prefix, "", is not the real one, see prefix C3.
L3 doc-exampleKOneither the legacy page nor any other documentation has an example that calls the macro. The only sample is on the page of the macro itself, {{iconPicker id="myPicker" class="fieldWithPicker" prefix="icon:" /}} , which no documentation shows. The example used for the audit is the most frequent call in XWiki Standard, {{iconPicker id="XWiki.TemplateProviderClass_0_icon" prefix="" /}} , in TemplateProviderSheet and in AppWithinMinutes TemplateProviderEditSheet, against one call with id="applicationIcon" prefix="icon:" in LiveTableEditSheet.
I1 patternOKcompared with children, the reference generator: both are inserted by their Quick Action without a dialog, and through the Insert Macro dialog with fields that are all optional. Nothing is macro-specific.
I2 zero-configKOQuick Actions and the Edit Macro dialog submitted with the default values insert {{iconPicker/}} . View mode shows nothing and no error, since without an id or a class the macro renders an empty script, and the editor shows only the generic placeholder, so nothing tells the user that the macro does nothing until it is configured. To reproduce: insert Icon Picker from Quick Actions and save.
I3 instantN/A
I4 cursorN/A
I5 focusKOthe macro has no mandatory parameter, but it does nothing without an id or a class, and neither the dialog nor the descriptor says so. The three fields are visible without scrolling and the focus is on Class, which is the field the examples of XWiki Standard never set. Essential parameters that are not mandatory are a KO, like the server fields of jira.
E1 wysiwygKOthe editor shows only the generic "macro:iconPicker" placeholder, while the macro has no visible output in view mode either: the placeholder does not say that the macro turns the input fields of the page into icon pickers, nor which fields. To reproduce: insert {{iconPicker id="XWiki.TemplateProviderClass_0_icon" prefix="" /}} , see XWIKI-23036.
E2 errorsKOinvalid values are accepted silently, and the macro renders nothing when it has no target. {{iconPicker id="my id"/}} renders the selector #my\ id with no message, {{iconPicker class="a b"/}} renders .a\ b, and {{iconPicker/}} , {{iconPicker id=""/}} and {{iconPicker prefix="icon"/}} render an empty script, so no picker is applied and no message explains why. The source is the Velocity of the wiki macro, which tests only that the id or the class is not empty. An unknown parameter is generic, not recorded.
E3 nestingOKin a list item, a table cell and a box, the macro renders with no error in the editor and in view mode, and the picker script applies to the target field like at the top level of the page.
E4 inline-supportOKthe macro declares inline support, and in the middle of a sentence it renders inline with no block element and no error: its only output is a script.
E5 emptyN/A
E6 inplaceN/A

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
idOKOKOKOKOKOKKOOKOKKO

C1: "DOM id of the input field where the picker will apply to" says what the id is for and what it targets, which is enough for a developer macro. It does not say that nothing happens when neither the id nor the class is set, which I5 covers.

C7: id and class are two ways to name the field that gets the picker, and the macro does nothing without one of them, but the dialog presents them as two unrelated optional fields and requires neither. To reproduce: insert {{iconPicker/}} from the Insert Macro dialog.

C13, minor: the id is any text, and {{iconPicker id="my id"/}} is accepted and escaped into the selector #my\ id, which matches no field, with no message. An id with no space is the format a DOM id must have.

C6: the dialog lists Class, Id and Prefix, while the calls of XWiki Standard set id and prefix and never class. The three fields are visible without scrolling and in any order they are as easy to reach, so this is OK.

classOKOKOKOKOKOKKOKOOKKO

C1: "CSS class of inputs where the picker will apply to" says what the class targets, which is enough for a developer macro, with a single class name and no dot.

C7: see id, the class is the other way to name the fields that get the picker, and neither of them is required by the dialog.

C8, minor: no call of XWiki Standard sets class, only the sample on the page of the macro does, and it is not marked as advanced.

C13, minor: the class is a single class name, and {{iconPicker class="a b"/}} is accepted and escaped into the selector .a\ b, which matches no field, with no message.

prefixKOOKKOOKOKOKN/AOKOKOK

C1, minor: the description does not say that an empty value means no prefix at all, which is the value both calls of TemplateProviderSheet and TemplateProviderEditSheet use, and it states a default, "", that is wrong, see C3.

C3: the field opens empty and the description gives the default "", but the JavaScript of the picker uses "icon:", so a user who relies on the description gets the opposite order. The most common example sets prefix="" and the next one prefix="icon:", neither is preselected.

KOs and tickets

Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.

KOCriterionExisting ticketsNew tickets
D2D2 summaryXWIKI-25485
D4D4 quick-actionXWIKI-25444
L2L2 doc-parametersXINFRA-525
L3L3 doc-exampleXINFRA-526
I2I2 zero-configXWIKI-25513
I5I5 focusXWIKI-25486
E1E1 wysiwygXWIKI-25536
E2E2 errorsXWIKI-25197 (partial)XCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25486 (partial)
C7:idC7 alternatives, idXWIKI-25486
C13:idC13 constraints, idXWIKI-25197
C7:classC7 alternatives, classXWIKI-25486
C8:classC8 advanced, classXWIKI-25486
C13:classC13 constraints, classXWIKI-25197
C1:prefixC1 clarity, prefixXWIKI-25485
C3:prefixC3 defaults, prefixXWIKI-25486
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-25197ExistingC13:class C13:idE2
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25444NewD4
XWIKI-25485NewC1:prefix D2
XWIKI-25486NewC3:prefix C8:class C7:id C7:class I5E2
XINFRA-525NewL2
XINFRA-526NewL3
XWIKI-25513NewI2
XWIKI-25536NewE1

Known issues of this macro

No known issue is specific to this macro.
68 more known issues affect every macro: see the Known issues.

Get Connected