box

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

Audit

Macro ID
box
Source
XS
Type
Wrapper
Classification reason

Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-14
Auditor
Compared macros
info warning

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://www.xwiki.org/xwiki/bin/view/documentation/xs/user/base/page/edit/box-macro/
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-rendering/blob/xwiki-rendering-18.8.0/xwiki-rendering-macros/xwiki-rendering-macro-box/src/main/java/org/xwiki/rendering/internal/macro/box/DefaultBoxMacro.java
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, D3info, warning
Other sources specific to this macro
CriterionResultNotes
D1 wordingOK
D2 summaryOK
D3 categoryOK
D4 quick-actionKOQuick Actions finds the macro first for "box" and for the French name "BoƮte". The synonyms "frame", "border", "panel" and "callout" give no result.
L1 consistencyOKcompared with info and warning. They insert a default text from their own Quick Actions entries and require their content, while box has an optional content and its Quick Actions entry inserts an empty {{box/}} , see I4. The parameters cssClass, image, title and width are the same, the message macros inherit them. The difference of the mandatory content is by design.
L2 doc-parametersOK
L3 doc-exampleOK
I1 patternOK
I2 zero-configKO {{box/}} , inserted from Quick Actions or by the Edit Macro dialog submitted with the default values, shows a "macro:box" placeholder in the editor and renders nothing in view mode: the user expects a box on the page and sees none.
I3 instantOK
I4 cursorKOafter insertion from Quick Actions ("/box", then Enter), the macro is inserted as {{box/}} , a non-editable "macro:box" placeholder with no content area: typed text goes after the macro, and the only way to add content is the Edit Macro dialog.
I5 focusN/A
E1 wysiwygOK
E2 errorsKOinvalid values are accepted silently, with no message. For example, {{box width="abc"}}Text{{/box}} renders with style="width:abc", and {{box width="300"}}Text{{/box}} with style="width:300", which browsers ignore; {{box image="missing.png"}}Text{{/box}} renders a broken image, with no attachment missing.png on the page.
E3 nestingKOthe box renders in a list item, a table cell and a box, and a list, a table and a box render and can be edited inside its content. But in a list item and in a table cell, like * {{box}}The content to put in the box.{{/box}} , the box is inline and its content cannot be edited in place.
E4 inline-supportOKthe macro declares inline support, and renders as a span inside a sentence, as in the documentation example The command is {{box cssClass="command"}}mvn clean install{{/box}} and nothing else. .
E5 emptyKOthe box inserted from Quick Actions has no content area: it is a "macro:box" placeholder that never receives the cursor, see I4. A content emptied in the editor, on the other hand, stays a full-width area that one click puts the cursor in.
E6 inplaceKOthe content of a standalone box is edited in place, but the Edit Macro dialog still shows it as a wiki syntax text area, also when editing an existing box. The content of an inline box, in a sentence, a list item or a table cell, can only be edited through that text area.

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
$contentOKOKN/AOKN/AOKN/AN/AN/AN/A

C4: edited in place for a standalone box; the wiki syntax text area of the dialog is recorded under E6.

cssClassOKOKOKOKOKOKN/AKOOKN/A

C1: "A CSS class to add to the box element" uses technical terms, which fit a styling parameter: describing it another way would only be more confusing.

C8: a styling parameter that is rarely used, and no common example sets it, but it is not marked as advanced.

imageKOOKOKKOOKOKN/AOKOKN/A

C1: the description "the image which is to be displayed in the message box" calls the box a message box, which it is not, and does not say what value is expected, an attachment or a URL.

C4: a free text field, with no image picker, although the type is a resource reference; a reference to a missing attachment is accepted. XWIKI-22863 proposes to deprecate the image of the box macro.

titleKOOKOKOKOKOKN/AOKOKN/A

C1: the description "the title which is to be displayed in the message box" calls the box a message box, which it is not. It does not say either that the title accepts wiki syntax.

C6: the parameters are in alphabetical order, cssClass, image, title, width. The most common example sets none of them, so the order is OK per the measure, but title is the one users are most likely to set.

widthOKOKOKOKOKOKN/AOKOKKO

C13: only accepts a CSS length "in px or %", but declares no format: "abc" is accepted by the dialog and output as style="width:abc", and "300" without a unit as style="width:300".

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
D4D4 quick-actionXWIKI-25444, XWIKI-25531
I2I2 zero-configXRENDERING-827
I4I4 cursorXWIKI-24152
E2E2 errorsXCOMMONS-3847 (partial), XRENDERING-823 (partial), XRENDERING-826 (partial), XRENDERING-828 (partial)
E3E3 nestingXWIKI-19954, XWIKI-23309 (partial)
E5E5 emptyXWIKI-24152
E6E6 inplaceXWIKI-19954 (partial)XWIKI-25443
C8:cssClassC8 advanced, cssClassXRENDERING-824
C1:imageC1 clarity, imageXWIKI-25492
C4:imageC4 input-assistance, imageXRENDERING-828
C1:titleC1 clarity, titleXWIKI-25492
C13:widthC13 constraints, widthXRENDERING-826
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-19954ExistingE3E6
XWIKI-23309ExistingE3
XWIKI-24152ExistingE5 I4
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25443NewE6
XWIKI-25444NewD4
XWIKI-25492NewC1:image C1:title
XRENDERING-824NewC8:cssClass
XRENDERING-826NewC13:widthE2
XRENDERING-827NewI2
XRENDERING-828NewC4:imageE2
XWIKI-25531NewD4

Known issues of this macro

IssueTitleStatusCriteria
CKEDITOR-266Hidden 'Content' parameter for 'Box' macro after pressing 'Change Macro' buttonOpenC6
CKEDITOR-296Cannot remove the box macro title once setOpen
CKEDITOR-375Editing the home page shows a not rendered box macroOpenE1
XWIKI-24152Add a placeholder to the Box MacroOpenE5

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

Get Connected