This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-facad933-91ac-467c-b09c-ce9eb973f8ff XWIKI-25294 Open

The cssClass parameter of the Container macro removes the columns layout

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-9394a68f-af91-4dce-9559-aeebae97ddcc Charpentier Lucas created this issue on 14/Oct/26 18:01
 
Summary: The cssClass parameter of the Container macro removes the columns layout
Issue Type: cid:jira-generated-image-avatar-facad933-91ac-467c-b09c-ce9eb973f8ff Bug
Affects Versions: 18.8.0
Assignee: Unassigned
Components: Rendering - Container Macro
Created: 14/Oct/26 18:01
Priority: cid:jira-generated-image-static-major-953969eb-b815-4592-88f3-77d53bdadb27 Major
Reporter: Charpentier Lucas
Description:

The cssClass parameter of the Container macro replaces the classes that the layout sets on the container, instead of adding to them. With layoutStyle="columns", the container-columns classes are lost, so the content is no longer laid out in columns.

AbstractContainerMacro lays out the container first, then calls containerRoot.setParameter("class", cssClass), which overwrites the class attribute set by ColumnsLayoutManager and the container-justified class set by justify.

Steps to reproduce

  1. Create a page with this content:
    {{container layoutStyle="columns" cssClass="mine"}}
    (((A)))
    (((B)))
    {{/container}}
    
  2. View the page.

Expected

A and B are displayed as two columns, and the container has the classes container-columns container-columns-2 mine.

Actual

A and B are displayed one below the other, and the container only has the class mine.

Found while auditing the Container macro: https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/container/