Going Stellar

Home/Confluence storage format reference

Confluence storage format

ac:layout page layouts in Confluence storage format

ac:layout turns a page into rows (sections) of columns (cells). The documentation lists single, two_equal, two_left_sidebar, two_right_sidebar, three_equal and three_with_sidebars. Content that does not follow the structure is wrapped or moved when the page is saved from the editor.

Storage format

<ac:layout>
<ac:layout-section ac:type="two_equal">
<ac:layout-cell><p>left</p></ac:layout-cell>
<ac:layout-cell><p>right</p></ac:layout-cell>
</ac:layout-section>
</ac:layout>

As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

<ac:layout><ac:layout-section ac:type="single"><ac:layout-cell><p>one</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="three_with_sidebars"><ac:layout-cell><p>l</p></ac:layout-cell><ac:layout-cell><p>m</p></ac:layout-cell><ac:layout-cell><p>r</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="single"><ac:layout-cell><p>end</p></ac:layout-cell></ac:layout-section></ac:layout>
{
 "type": "doc",
 "content": [
  {
   "type": "layoutSection",
   "content": [
    {
     "type": "layoutColumn",
     "attrs": {
      "width": 100.0
     },
     "content": [
      {
       "type": "paragraph",
       "content": [
        {
         "text": "one",
         "type": "text"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "type": "layoutSection",
   "content": [
    {
     "type": "layoutColumn",
     "attrs": {
      "width": 25.0
     },
     "content": [
      {
       "type": "paragraph",
       "content": [
        {
         "text": "l",
         "type": "text"
        }
       ]
      }
     ]
    },
    {
     "type": "layoutColumn",
     "attrs": {
      "width": 50.0
     },
     "content": [
      {
       "type": "paragraph",
       "content": [
        {
         "text": "m",
         "type": "text"
        }
       ]
      }
     ]
    },
    {
     "type": "layoutColumn",
     "attrs": {
      "width": 25.0
     },
     "content": [
      {
       "type": "paragraph",
       "content": [
        {
         "text": "r",
         "type": "text"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "type": "layoutSection",
   "content": [
    {
     "type": "layoutColumn",
     "attrs": {
      "width": 100.0
     },
     "content": [
      {
       "type": "paragraph",
       "content": [
        {
         "text": "end",
         "type": "text"
        }
       ]
      }
     ]
    }
   ]
  }
 ],
 "version": 1
}

Examples

Storage format sent

<ac:layout><ac:layout-section ac:type="single"><ac:layout-cell><p>one</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="three_with_sidebars"><ac:layout-cell><p>l</p></ac:layout-cell><ac:layout-cell><p>m</p></ac:layout-cell><ac:layout-cell><p>r</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="single"><ac:layout-cell><p>end</p></ac:layout-cell></ac:layout-section></ac:layout>

The mixed layout from the storage format page: a full-width row, a row with two narrow side cells and a wide middle cell, and a full-width row again.

Rendered view (HTML)

<div class="contentLayout2">
<div class="columnLayout single" data-layout="single">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>one</p></div>
</div>
</div>
<div class="columnLayout three-with-sidebars" data-layout="three-with-sidebars">
<div class="cell sidebars" data-type="sidebars">
<div class="innerCell">
<p>l</p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>m</p></div>
</div>
<div class="cell sidebars" data-type="sidebars">
<div class="innerCell">
<p>r</p></div>
</div>
</div>
<div class="columnLayout single" data-layout="single">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>end</p></div>
</div>
</div>
</div>

Storage format after the round trip through ADF

<ac:layout><ac:layout-section ac:type="single" ac:breakout-mode="default"><ac:layout-cell><p>one</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="three_with_sidebars" ac:breakout-mode="default"><ac:layout-cell><p>l</p></ac:layout-cell><ac:layout-cell><p>m</p></ac:layout-cell><ac:layout-cell><p>r</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="single" ac:breakout-mode="default"><ac:layout-cell><p>end</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_left_sidebar"><ac:layout-cell><p>a</p></ac:layout-cell><ac:layout-cell><p>b</p></ac:layout-cell></ac:layout-section></ac:layout>

A two-column row with a narrow left cell. The rendered markup marks the left 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="four_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-cell><p>d</p></ac:layout-cell></ac:layout-section></ac:layout>

four_equal, a type the documentation does not list. Storage accepts it, but the page renders three columns.

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><p>d</p></div>
</div>
</div>
</div>

Storage format after the round trip through ADF

<ac:layout><ac:layout-section ac:type="four_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-cell><p>d</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 section with only one cell, which breaks the rule that the cell count must match the type.

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 .

Storage format sent

<p>before</p><ac:layout><ac:layout-section ac:type="single"><ac:layout-cell><p>layout not first</p></ac:layout-cell></ac:layout-section></ac:layout>

A layout placed after a paragraph, although the documentation says ac:layout should be the top level element.

Rendered view (HTML)

<p>before</p><div class="contentLayout2">
<div class="columnLayout single" data-layout="single">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>layout not first</p></div>
</div>
</div>
</div>

Storage format after the round trip through ADF

<ac:layout><ac:layout-section ac:type="fixed-width" ac:breakout-mode="default"><ac:layout-cell><p>before</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type="single" ac:breakout-mode="default"><ac:layout-cell><p>layout not first</p></ac:layout-cell></ac:layout-section></ac:layout>

Sent to Confluence Cloud on .

What changes in conversion

  • Every ac:layout-section gains ac:breakout-mode="default" after an editor save. Section types and cell contents are kept.
  • A section whose cell count does not match its type is not converted. ADF holds it as a legacy-content extension with the reason incompatible-page-layout-section, and the storage read back has the ac:layout-section without its ac:layout wrapper.
  • Content before an ac:layout is moved into a new first section of type fixed-width, so the layout becomes the top level element.
  • four_equal is kept in storage, but the rendered view puts the fourth cell's content into the third column.

Pitfalls

  • Match the cell count to the type. A mismatch renders with an empty extra cell and is converted to a legacy content block by the editor.
  • Do not put content before ac:layout. After the editor saves the page it ends up in a separate fixed-width section.
  • Use only the six documented types. four_equal is saved but does not render as four columns.

Questions and answers

Which section types were tested?

single, two_equal, two_left_sidebar, three_equal, three_with_sidebars and four_equal. two_right_sidebar is documented but was not probed.

Sources

  1. Confluence storage format (Atlassian Documentation)
  2. Atlassian Document Format: document structure (Atlassian Developer)
  3. The legacy content macro (Atlassian Support)

Markdown version · All storage format pages