mention

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

Audit

Macro ID
mention
Source
XS
Type
Generator
Classification reason
The macro has no content: its whole output is the link to the user given by its reference parameter, shown with the name read from the user profile, so it is classified as a generator.
Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-20
Auditor
Compared macros
notifications useravatar

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/Mentions%20Application/#HUsingtheSourceEditor
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/xwiki-platform-18.8.0/xwiki-platform-core/xwiki-platform-mentions/xwiki-platform-mentions-ui/src/main/resources/XWiki/Mentions/MentionsMacro.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, D3notifications, useravatar
Other sources specific to this macro
  • MentionsMacro, xwiki-platform: a wiki macro with no content, whose parameters declare no constraint and whose code reads the unset anchor as unexpanded Velocity text.
  • Mentions Application: the only documentation, with the dedicated "Mention" Quick Actions entry that inserts the macro with a generated anchor.
  • The uses of the macro in XWiki Standard are tests only, MentionsIT, QuickActionsIT and NotificationsEmailsIT, which call it with a reference, a style and an anchor.
CriterionResultNotes
D1 wordingOK"User Mention" is the user's word for what the macro produces.
D2 summaryKO"Insert a user mention." repeats the name "User Mention" behind the filler "Insert". It does not say that the macro writes a link to the user, shown as @ followed by their name, nor that the mentioned user gets a notification when the page is saved, which the documentation states.
D3 categoryOKNotifications, like the compared macro notifications. The other compared macro, useravatar, is in Content.
D4 quick-actionKOthe synonyms are "tag user", "ping user", "at user" and "mention user". "mention" lists the dedicated Quick Actions entry "Mention" first and "User Mention", the macro entry, third. "User Mention" and "user mention" give the macro first, and so does the French name "Mention Utilisateur". None of the four synonyms gives any result. Whether each one is worth supporting is decided when filing the ticket.
L1 consistencyOKcompared with notifications and useravatar, two generators with a mandatory or essential first parameter. Like them, the Quick Actions entry "User Mention" and the Insert Macro dialog open the Edit Macro dialog with a picker for the mandatory reference. The dedicated "Mention" entry is the difference with them, counted under I1.
L2 doc-parametersKOthe parameters are only documented on the legacy extensions.xwiki.org page of the Mentions Application, not in the new documentation. That page also marks style and anchor as not optional, while the macro declares them optional, gives the empty string as the default of anchor and type, which the macro does not declare, and omits the FULL_NAME default that the macro declares for style.
L3 doc-exampleOKthe documentation gives the three calls {{mention reference="XWiki.Admin" style="FULL_NAME" anchor="xwiki-XWiki.Admin-123456"/}} , one for each style, in the Using the Source Editor section. The first one is the most common example, picked as the first documented example that renders. It renders without error on a wiki where the user Admin exists, the setup step the documentation states.
I1 patternKOfrom the Quick Actions menu and the Insert Macro dialog, the entry "User Mention" opens the Edit Macro dialog, since the reference is mandatory, like useravatar and notifications. Quick Actions also lists a dedicated entry "Mention", described "Mention someone to send them a notification.": it inserts an "@", lists the users matching what the user types, and writes {{mention reference="XWiki.Admin" style="FULL_NAME" anchor="XWiki-Admin-quqyis"/}} with a generated anchor, without opening the dialog. Two Quick Actions entries insert the same macro, with two different behaviors, and the generic one is listed next to the dedicated one.
I2 zero-configOKinserting from the Edit Macro dialog with only the reference gives {{mention reference="XWiki.Admin"/}} , which renders the @Administrator link with no error. The dialog refuses to submit an empty reference with no message, the generic behavior of the dialog, and {{mention/}} typed in the source gives "Parameter [reference] is mandatory" in view mode, acceptable for a generator that needs its user. Without an anchor the id attribute of the link holds the text $escapetool.xml($anchor) unexpanded, see the bugs outside the criteria.
I3 instantN/A
I4 cursorN/A
I5 focusOKthe mandatory Reference field comes first, outside any group, is visible without scrolling and has the focus when the dialog opens.
E1 wysiwygOKthe macro renders the same red @Administrator link in the editor and in view mode, so it needs no placeholder.
E2 errorsKOinvalid values are accepted silently. {{mention reference="XWiki.NoSuchUser"/}} and {{mention reference="John Doe"/}} render a link to a page that does not exist, as @NoSuchUser and @John Doe, and {{mention reference="Main.WebHome"/}} mentions a page. {{mention reference=""/}} renders @Administrator, the link of the current space, and data-reference holds the unexpanded Velocity text. style="maybe" , style="NICK" and style="" fall back to the full name with no message, while the wrong case style="login" is accepted. anchor="my anchor" gives the invalid HTML id "my anchor". type="robot" renders the raw reference text xwiki:XWiki.Admin instead of the name. A missing reference gives "Parameter [reference] is mandatory", which names the parameter but not what to give.
E3 nestingOKin a list item, a table cell, a box, a heading and a numbered list, {{mention reference="XWiki.Admin" style="FULL_NAME" anchor="e3"/}} renders its link with no error, inline, and can be edited through its dialog as at the top level.
E4 inline-supportOKthe macro declares inline support and renders inside a sentence, as a link with no block element.
E5 emptyN/A
E6 inplaceN/A

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
referenceKOOKN/AOKOKOKN/AOKOKN/A

C1, minor: the label "Reference" is a developer word for a field that picks a person, and the useravatar macro calls the same thing "Username". The description "The mentioned user or group reference." speaks of groups, which the picker does not offer: searching "Group" or "XWikiAdminGroup" lists nothing.

C2: mandatory with no default, which is right: the mentioned user is the whole purpose of the macro.

C3: N/A, mandatory and without a default.

C4: a user picker, titled "Pick a user.". It lists Administrator and John Doe when opened, "Adm" lists Administrator and "John" lists John Doe. Picking a user writes reference="XWiki.Admin" . Groups cannot be found.

C5: Reference is outside any group, the three other fields are in the Optional parameters tab.

C6: Reference, set in the most common example, comes first.

C13: N/A, the accepted values are the users of the wiki, picked from a list.

styleOKOKOKOKOKOKN/AOKOKN/A

C1: "Display Style" with the options "Full name of the user" and the like says what it changes.

C2: optional with a default.

C3: the field opens on the declared default FULL_NAME, the value of the most common example.

C4: a select with the three styles.

C5: in the Optional parameters tab, with two other fields.

C6: set in the most common example, after Anchor and before Type, which the example does not set.

C8: set in the most common example, and not advanced.

C9: set in the documentation examples.

C13: N/A, a select, so the dialog cannot produce an invalid value, see E2 for the source.

anchorKOOKKOOKOKOKN/AKOOKKO

C1, minor: "The anchor to be used for linking to that mention (this anchor should be unique to the document as much as possible)." does not say what the anchor is for, what an empty value does, nor how to choose a unique one. The documentation suggests a random string from random.org.

C2: optional, as the macro renders with no anchor.

C3: the field opens empty, and the examples set a different value for each mention, like xwiki-XWiki.Admin-123456, so no single default exists. The dedicated "Mention" entry generates one, like XWiki-Admin-quqyis, which the dialog could preselect. An empty anchor gives the id $escapetool.xml($anchor) unexpanded, see E2.

C4: a plain text field for an identifier, no picker applies.

C5: in the Optional parameters tab, with two other fields.

C6: set in the most common example, comes first in the tab, before Display Style.

C8: set in the most common example, but a value that the editor generates and that users do not choose, so rarely edited and not marked as advanced.

C9: set in the documentation examples, which type the anchor by hand, so the field stays visible. Hiding it would leave the mentions inserted from the dialog with no anchor; the fix is for the dialog to generate one and mark it advanced, see C3 and C8.

C13: a format, an HTML id with no space that is unique in the page, that the wiki macro cannot declare, see XWIKI-25197 in the Cross-macro findings: anchor="my anchor" is accepted and output as an invalid id, see E2.

typeKOOKKOKOOKOKN/AKOOKKO

C1: "The type of the mentioned actor." does not give the values to type, user being the only one in XWiki Standard, nor the default.

C2: optional.

C3: the field opens empty, which stands for "user", the value of every use in XWiki Standard. Nothing in the dialog shows it.

C4, minor: a free text field with one predefined value, user, that a select could offer, like the style of dashboard.

C5: in the Optional parameters tab, with two other fields.

C6: not set in the most common example, comes last in the tab.

C8: not advanced, while its only value in XWiki Standard is the default one and extensions are the only reason to change it.

C9: not shown in the examples, but meant to be extended by other extensions, so the field is not hidden.

C13: only a list of types is accepted, which the wiki macro cannot declare, see XWIKI-25197 in the Cross-macro findings: type="robot" is accepted and shows the raw reference, see E2.

Other notes

Bugs outside the criteria, to file in JIRA: without anchor, {{mention reference="XWiki.Admin"/}} outputs the id $escapetool.xml($anchor) unexpanded, and with an empty reference the data-reference attribute is unexpanded too, since the macro code reads a parameter that is not set. The reference description speaks of a group, while the picker only lists users and type="group" shows the raw reference.

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-25487
D4D4 quick-actionXWIKI-25444
L2L2 doc-parametersXINFRA-525
I1I1 patternXWIKI-25564
E2E2 errorsXCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25504 (partial), XWIKI-25583 (partial)
C1:referenceC1 clarity, referenceXWIKI-25487
C1:anchorC1 clarity, anchorXWIKI-25487
C3:anchorC3 defaults, anchorXWIKI-25488
C8:anchorC8 advanced, anchorXWIKI-25488
C13:anchorC13 constraints, anchorXWIKI-25197
C1:typeC1 clarity, typeXWIKI-25487
C3:typeC3 defaults, typeXWIKI-25488
C4:typeC4 input-assistance, typeXWIKI-23045 (partial)XWIKI-25504
C8:typeC8 advanced, typeXWIKI-25488
C13:typeC13 constraints, typeXWIKI-25197
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-25197ExistingC13:anchor C13:type
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25444NewD4
XWIKI-25487NewC1:anchor C1:reference C1:type D2
XWIKI-25488NewC3:anchor C3:type C8:anchor C8:type
XWIKI-23045ExistingC4:type
XWIKI-25504NewC4:typeE2
XINFRA-525NewL2
XWIKI-25564NewI1
XWIKI-25583NewE2

Known issues of this macro

IssueTitleStatusCriteria
XWIKI-20158Mention Macro is placed at the beginning of the line when inserted in-line on SafariOpen

68 more known issues affect every macro: see the Known issues.

Get Connected