gallery

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

Audit

Macro ID
gallery
Source
XS
Type
Wrapper
Classification reason

Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-15
Auditor
Compared macros
figure container

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/Gallery%20Macro#HUsage
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-gallery/src/main/java/org/xwiki/rendering/internal/macro/gallery/GalleryMacro.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, D3figure, container
Other sources specific to this macro
CriterionResultNotes
D1 wordingOK
D2 summaryOK
D3 categoryOKthe macro is in the Layout category, like container, which fits it: a gallery is not as technical as figure, which is in Development.
D4 quick-actionKOQuick Actions finds the macro first for "gallery" and for the French and German name "Galerie", and first for the synonyms "slideshow", "images" and "slider". The synonyms "carousel", the word the documentation uses for the slide-show, and "photos" give no result.
L1 consistencyKOcompared with figure and container. Both have an optional rich text content edited in place and are inserted by their Quick Action without a dialog, while the gallery content is mandatory and uses a format of its own, a plain text listing images in wiki syntax, like image:[email protected] one per line, so its Quick Action opens the Edit Macro dialog, see I3 and E6. None of the three declares a default value.
L2 doc-parametersKOthe parameters are only documented on the legacy extensions.xwiki.org page, not in the new documentation. Its parameter table does not list the content, nor that it is mandatory, and gives the 620px and 349px defaults of width and height, which the macro descriptor does not declare: they come from the gallery stylesheet.
L3 doc-exampleOKthe Usage example {{gallery}}image:alice.png ... {{/gallery}} renders without error, with broken images when the attachments do not exist; the audit used it with existing images. The RSS example fails on XWiki Standard with "Unknown macro: rss", since the RSS macro is not bundled.
I1 patternKOthe reference wrapper, warning, is inserted by its Quick Action without a dialog; the gallery Quick Action opens the Edit Macro dialog, see I3. It follows the generic behavior of macros without a dedicated Quick Action, like comment.
I2 zero-configOKthe dialog cannot be submitted with the default values, since the content is mandatory and empty: it stays open, with no message, the generic behavior of the dialog. {{gallery/}} renders with no error.
I3 instantKOinserting from the Quick Actions menu with "/gallery" and Enter opens the Edit Macro dialog with an empty Content text area; the macro is only inserted after typing image references in wiki syntax and submitting.
I4 cursorKOafter submitting the dialog, the macro widget is selected and the cursor is not in its content: the content cannot be typed in place, see E6.
I5 focusN/A
E1 wysiwygKOthe editor shows the images of the content stacked one under the other, with no slide-show frame, navigation arrows or counter, while view mode shows a slide-show showing one image at a time. For example, the Usage example of the documentation, with two existing images, one per line, shows both images in the editor and a black 620 px slide-show showing "1 / 2" in view mode.
E2 errorsKOinvalid values are accepted silently, with no message. For example, {{gallery width="abc"}}image:[email protected]{{/gallery}} renders with style="width: abc;", and {{gallery height="300"}}image:[email protected]{{/gallery}} with style="height: 300;", which browsers ignore, so the gallery keeps its default size. A reference to a missing image, like image:alice.png , shows an endless loading spinner in the slide-show.
E3 nestingKOin a list item and in a table cell, like * {{gallery}}image:[email protected]{{/gallery}} , the gallery is inline and renders "The [gallery] macro is a standalone macro and it cannot be used inline." in the editor and in view mode; it works only when wrapped in a group, * ((( {{gallery}}...{{/gallery}} ))) , which the editor does not create. In a box it works. A list, a table or a box in its content, like {{gallery}}* one{{/gallery}} , is shown in the editor but silently dropped in view mode, which shows an empty "0 / 0" slide-show.
E4 inline-supportOKthe macro declares no inline support, and its output is a block slide-show with a fixed size, which cannot be inside a sentence.
E5 emptyOKthe content is never edited in place, so it cannot be emptied in the editor. A gallery with an empty content, {{gallery/}} , keeps the visible "macro:gallery" placeholder, which one click selects; its content is edited through the dialog, counted under E6.
E6 inplaceKOthe content is a plain text of wiki syntax, not rich text, and is edited only in a text area of the Edit Macro dialog: the editor shows the images, but they cannot be added, removed or reordered in place, and adding an image means typing its reference in wiki syntax, like image:[email protected] .

Parameters

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

C1: the description asks for images "specified using the syntax of the current page", with an example for "XWiki 2.0 syntax": technical terms, and an outdated syntax version. It does not say that anything other than images, like text or a list, is dropped.

C4: a plain text area of wiki syntax in the Edit Macro dialog, counted under E6.

classKOOKOKOKOKOKN/AKOOKN/A

C1: the name is the parameter ID, "Class", in every language, and French and German show the English description "Custom CSS class names to set on the gallery container".

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

heightKOOKOKOKOKOKN/AOKOKKO

C1: the description "The gallery height" repeats the name and does not say what value is expected, a CSS length like 349px, nor that an empty value keeps the default height of 349px. The name is the parameter ID in every language, and French and German show the English description.

C3: the field opens empty, which gives the default height of 349px of the gallery stylesheet, the value of the most common example; the default is not declared nor shown.

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

widthKOOKOKOKOKOKN/AOKOKKO

C1: the description "The gallery width" repeats the name and does not say what value is expected, a CSS length like 620px or 100%, nor that an empty value keeps the default width of 620px. The name is the parameter ID in every language, and French and German show the English description.

C3: the field opens empty, which gives the default width of 620px of the gallery stylesheet, the value of the most common example; the default is not declared nor shown.

C13: only accepts a CSS length, 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
L1L1 consistencyXWIKI-25506
L2L2 doc-parametersXINFRA-525
I1I1 patternXWIKI-25563
I3I3 instantXWIKI-16308, XWIKI-23735XWIKI-25563
I4I4 cursorXWIKI-25569
E1E1 wysiwygXWIKI-25523 (partial), XWIKI-25524
E2E2 errorsXCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25508 (partial), XWIKI-25582 (partial)
E3E3 nestingXWIKI-23501XWIKI-25560
E6E6 inplaceXWIKI-23735 (partial)XWIKI-25571
C1:$contentC1 clarity, $contentXWIKI-25481
C1:classC1 clarity, classXWIKI-25481
C8:classC8 advanced, classXWIKI-25482
C1:heightC1 clarity, heightXWIKI-25481
C13:heightC13 constraints, heightXWIKI-25508
C1:widthC1 clarity, widthXWIKI-25481
C13:widthC13 constraints, widthXWIKI-25508
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-16308ExistingI3
XWIKI-23501ExistingE3
XWIKI-23735ExistingI3E6
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25444NewD4
XWIKI-25481NewC1:$content C1:class C1:height C1:width
XWIKI-25482NewC8:class
XWIKI-25506NewL1
XINFRA-525NewL2
XWIKI-25508NewC13:height C13:widthE2
XWIKI-25523NewE1
XWIKI-25524NewE1
XWIKI-25560NewE3
XWIKI-25563NewI1 I3
XWIKI-25569NewI4
XWIKI-25571NewE6
XWIKI-25582NewE2

Known issues of this macro

IssueTitleStatusCriteria
XWIKI-23735Provide an image picker for the Gallery macro when used in WYSIWYGOpenC4

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

Get Connected