Home/Confluence storage format reference
Confluence storage format
section and column macros in Confluence storage format
The section macro holds column macros and puts them side by side. The Cloud documentation marks both as legacy macros that cannot be inserted in the Cloud editor. In the probes, existing section and column macros were rewritten into the layout elements of the Cloud editor when the page went through ADF.
Storage format
<ac:structured-macro ac:name="section"><ac:parameter ac:name="border">true</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="column"><ac:parameter ac:name="width">50%</ac:parameter><ac:rich-text-body><p>col 1</p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="column"><ac:rich-text-body><p>col 2</p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>
<ac:layout><ac:layout-section ac:type="two_equal"><ac:layout-cell><p>a</p></ac:layout-cell><ac:layout-cell><p>b</p></ac:layout-cell></ac:layout-section></ac:layout>
In the editor
| How | Note |
|---|---|
| Use the layout options of the Cloud editor instead of the section and column macros | Per the Atlassian documentation. |
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<ac:structured-macro ac:name="section"><ac:rich-text-body><ac:structured-macro ac:name="column"><ac:parameter ac:name="width">50%</ac:parameter><ac:rich-text-body><p>col 1</p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="column"><ac:rich-text-body><p>col 2</p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>
{
"type": "doc",
"content": [
{
"type": "layoutSection",
"content": [
{
"type": "layoutColumn",
"attrs": {
"width": 50.0
},
"content": [
{
"type": "paragraph",
"content": [
{
"text": "col 1",
"type": "text"
}
]
}
]
},
{
"type": "layoutColumn",
"attrs": {
"width": 50.0
},
"content": [
{
"type": "paragraph",
"content": [
{
"text": "col 2",
"type": "text"
}
]
}
]
}
]
}
],
"version": 1
}
Examples
Storage format sent
<ac:structured-macro ac:name="section"><ac:rich-text-body><ac:structured-macro ac:name="column"><ac:parameter ac:name="width">50%</ac:parameter><ac:rich-text-body><p>col 1</p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="column"><ac:rich-text-body><p>col 2</p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>Two columns built with the legacy macros, the first one 50% wide. Solves a side-by-side block on a page written before the Cloud editor.
Rendered view (HTML)
<div class="sectionColumnWrapper conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="section"><div class="sectionMacro"><div class="sectionMacroRow"><div class="columnMacro conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="column" style="width:50%;min-width:50%;max-width:50%;"><p>col 1</p></div><div class="columnMacro conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="column"><p>col 2</p></div></div></div></div>Storage format after the round trip through ADF
<ac:layout><ac:layout-section ac:type="two_equal" ac:breakout-mode="default"><ac:layout-cell><p>col 1</p></ac:layout-cell><ac:layout-cell><p>col 2</p></ac:layout-cell></ac:layout-section></ac:layout>Sent to Confluence Cloud on .
Storage format sent
ADF:{"content": [{"content": [{"attrs": {"width": 33.33}, "content": [{"content": [{"text": "a", "type": "text"}], "type": "paragraph"}], "type": "layoutColumn"}, {"attrs": {"width": 66.66}, "content": [{"content": [{"text": "b", "type": "text"}], "type": "paragraph"}], "type": "layoutColumn"}], "type": "layoutSection"}], "type": "doc", "version": 1}ADF with a narrow column (33.33) next to a wide one (66.66). Confluence stores it as the two_left_sidebar layout, which renders the first cell as an aside.
Rendered view (HTML)
<div class="contentLayout2">
<div class="columnLayout two-left-sidebar" data-layout="two-left-sidebar">
<div class="cell aside" data-type="aside">
<div class="innerCell">
<p>a</p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>b</p></div>
</div>
</div>
</div>Storage format after the round trip through ADF
<ac:layout><ac:layout-section ac:type="two_left_sidebar" ac:breakout-mode="default"><ac:layout-cell><p>a</p></ac:layout-cell><ac:layout-cell><p>b</p></ac:layout-cell></ac:layout-section></ac:layout>Sent to Confluence Cloud on .
Storage format sent
<ac:layout><ac:layout-section ac:type="three_equal"><ac:layout-cell><p>a</p></ac:layout-cell><ac:layout-cell><p>b</p></ac:layout-cell><ac:layout-cell><p>c</p></ac:layout-cell></ac:layout-section></ac:layout>Three equal cells in a three_equal layout section. The view shows one columnLayout container with three cells.
Rendered view (HTML)
<div class="contentLayout2">
<div class="columnLayout three-equal" data-layout="three-equal">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>a</p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>b</p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>c</p></div>
</div>
</div>
</div>Storage format after the round trip through ADF
<ac:layout><ac:layout-section ac:type="three_equal" ac:breakout-mode="default"><ac:layout-cell><p>a</p></ac:layout-cell><ac:layout-cell><p>b</p></ac:layout-cell><ac:layout-cell><p>c</p></ac:layout-cell></ac:layout-section></ac:layout>Sent to Confluence Cloud on .
Storage format sent
<ac:layout><ac:layout-section ac:type="two_equal"><ac:layout-cell><p>only one cell</p></ac:layout-cell></ac:layout-section></ac:layout>A two_equal layout section that holds only one cell. The view shows an empty second cell, but the ADF conversion refuses the section.
Rendered view (HTML)
<div class="contentLayout2">
<div class="columnLayout two-equal" data-layout="two-equal">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>only one cell</p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p></p></div>
</div>
</div>
</div>Storage format after the round trip through ADF
<ac:layout-section ac:type="two_equal"><ac:layout-cell><p>only one cell</p></ac:layout-cell></ac:layout-section>Sent to Confluence Cloud on .
What changes in conversion
- The section and column macros did not stay macros. The ADF Confluence builds from them is a layoutSection with two layoutColumn nodes, and saving that ADF writes ac:layout, ac:layout-section and ac:layout-cell elements.
- A column with width=50% and an unnamed second column both became width 50 and the type two_equal. Other width combinations (for example 30% and 70%) were not probed, so how they map is unknown.
- The section parameter border and the pixel widths shown in the documentation example have no counterpart in the converted ADF of the probe. The probe did not send border, so only the column width was checked.
- A layout section with fewer cells than its type needs is not converted. The ADF holds a legacy-content extension with the reason incompatible-page-layout-section, and storage comes back as a bare ac:layout-section without the surrounding ac:layout element.
Pitfalls
- The documentation says legacy macros can remain inside a legacy content macro in the Cloud editor. The probe did not do that for section and column; the ADF conversion produced layout nodes.
- After the ADF round trip every layout section carries ac:breakout-mode="default". Content written without that attribute is saved with it.
- The view of a section macro and the view of a layout are different HTML structures (sectionColumnWrapper versus contentLayout2), so CSS or scripts that target one will not match the other.
Questions and answers
Does a column width in pixels survive?
Not probed. Only a 50% width was sent, and it became an equal two-column layout.
Related
Sources
- Confluence storage format (Atlassian Documentation)
- Macros that are unavailable or have limited availability in the Cloud editor (Atlassian Support)
- Review macros only available in the legacy editor (Atlassian Support)
- Insert the section macro (Atlassian Support)
- Insert the column macro (Atlassian Support)