container

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

Audit

Macro ID
container
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
box gallery

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/Container%20Macro
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-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-container/src/main/java/org/xwiki/rendering/internal/macro/container/ContainerMacro.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, D3box, gallery
Other sources specific to this macro
CriterionResultNotes
D1 wordingKO"Container" is a developer term for what the documentation shows users as columns: its only usable example is {{container layoutStyle="columns"}} , the other one, "grid", being a layout that a developer has to implement.
D2 summaryKOthe description "A macro to enclose multiple groups and add decoration, such as layout." does not say what the macro adds to the page, columns, the only layout available: "groups" is a wiki syntax term and "decoration" is vague.
D3 categoryOK
D4 quick-actionKOQuick Actions finds the macro first for "container", for the French name "Conteneur" and for the synonym "layout". The synonyms "columns" and "grid" give no result, although columns are the only layout of the macro.
L1 consistencyOKcompared with box and gallery. Like box, the content is optional and Quick Actions inserts an empty {{container/}} without a dialog; gallery requires its content, which is by design.
L2 doc-parametersKOthe parameters are documented only on the legacy page Container Macro, not in the new documentation, and that page does not document cssClass nor the content.
L3 doc-exampleOK
I1 patternOK
I2 zero-configKO {{container/}} , inserted from Quick Actions, and {{container}}{{/container}} , inserted by the Edit Macro dialog submitted with the default values, show a "macro:container" placeholder in the editor and render an empty div in view mode: the user sees nothing. With a content but the default values, no layout is applied either, since layoutStyle has no default.
I3 instantOK
I4 cursorKOafter insertion from Quick Actions ("/container", then Enter), the macro is a non-editable "macro:container" 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: {{container layoutStyle="grid"}}(((first)))(((second))){{/container}} and {{container layoutStyle="Columns"}}...{{/container}} render the content without any layout, {{container justify="abc"}}Text{{/container}} renders as justify="false", and {{container justify="true"}}Text{{/container}} without layoutStyle="columns" has no effect, since the CSS of the justified class is only loaded by the columns layout.
E3 nestingKOin a list item and in a table cell the macro fails in view mode with "The [container] macro is a standalone macro and it cannot be used inline". Inserting it from Quick Actions at the start of a new list item gives * {{container/}}((( ))) and the same error, in the editor and in view mode. In a box it renders, but its content, like a list, a table or a box inside it, can never be edited in place, see E6.
E4 inline-supportOK
E5 emptyKOthe container inserted from Quick Actions has no content area: it is a "macro:container" placeholder that never receives the cursor, see I4. The content of an existing container is not editable in place either, see E6, so it cannot be emptied in the editor.
E6 inplaceKOthe content is never edited in place, even {{container}}Some text{{/container}} with no layout: the whole macro is a read-only widget and the content can only be edited in the wiki syntax text area of the Edit Macro dialog. The content type is a list of blocks, but the macro does not mark its parsed content as non-generated content, unlike box. Columns are also groups, (((...))) , which the editor cannot create.

Parameters

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

C1: the description "The content to enclose in this container (wiki syntax). For the "columns" layout, a group should be added for each column." relies on the wiki syntax term "group", (((...))) , which a WYSIWYG user does not know and cannot insert.

C4: edited in the wiki syntax text area of the Edit Macro dialog only, recorded under E6.

cssClassOKOKOKOKOKOKN/AKOOKN/A

C1: the description "Value of the HTML class attribute to add to this container, used to style in CSS." uses technical terms, which fit a styling parameter. It says "add", while the value replaces the classes of the layout, see XWIKI-25294.

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

justifyKOOKOKOKOKOKN/AOKOKN/A

C1, minor: the English name is the ID, "justify", and the description "Flag specifying whether the content in this container is justified or not." uses the technical term "flag" and does not say that it only has an effect with the columns layout: {{container justify="true"}}Text{{/container}} is not justified.

layoutStyleKOOKKOKOOKKON/AOKOKN/A

C1: the description "The identifier of the container layout (e.g. "columns")." uses the technical term "identifier" and does not list the accepted values nor say what the columns layout does, one column per group. Without it the macro renders its content as is.

C3: the most common example sets layoutStyle="columns", but the field opens empty, with no default value.

C4: a free text field, although the accepted values are the installed layouts, only "columns" in XWiki Standard: a select could be used. A typo or another case, like "Columns", is accepted and gives no layout, see E2.

C6: the parameters are in alphabetical order, cssClass, justify, layoutStyle. layoutStyle, the only parameter of the most common example, comes last.

C13: the accepted values are the installed layouts, a list rather than a range or a format, so it is recorded N/A: the select of C4 would declare them.

Other notes

The cssClass parameter replaces the classes set by the layout and justify instead of adding to it, so {{container layoutStyle="columns" cssClass="mine"}}(((first)))(((second))){{/container}} loses its columns: XWIKI-25294. It is a bug of the macro, not a usability criterion.

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
D1D1 wordingXWIKI-25481
D2D2 summaryXWIKI-25481
D4D4 quick-actionXWIKI-25444
L2L2 doc-parametersXINFRA-525
I2I2 zero-configXWIKI-25482 (partial), XWIKI-25567 (partial)
I4I4 cursorXWIKI-25569
E2E2 errorsXCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25502 (partial), XWIKI-25582 (partial)
E3E3 nestingXWIKI-23501 (partial)XWIKI-25567 (partial)
E5E5 emptyXWIKI-25567
E6E6 inplaceXWIKI-25443 (partial), XWIKI-25567
C1:$contentC1 clarity, $contentXWIKI-25481
C8:cssClassC8 advanced, cssClassXWIKI-25482
C1:justifyC1 clarity, justifyXWIKI-25481
C1:layoutStyleC1 clarity, layoutStyleXWIKI-25481
C3:layoutStyleC3 defaults, layoutStyleXWIKI-25482
C4:layoutStyleC4 input-assistance, layoutStyleXWIKI-23045 (partial)XWIKI-25502
C6:layoutStyleC6 order, layoutStyleXWIKI-25482
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-23501ExistingE3
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25443NewE6
XWIKI-25444NewD4
XWIKI-25481NewC1:$content C1:justify C1:layoutStyle D1 D2
XWIKI-25482NewC3:layoutStyle C6:layoutStyle C8:cssClassI2
XWIKI-23045ExistingC4:layoutStyle
XWIKI-25502NewC4:layoutStyleE2
XINFRA-525NewL2
XWIKI-25567NewE6 E5I2 E3
XWIKI-25569NewI4
XWIKI-25582NewE2

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