The layout-options property is defined in the front matter of a Page. It replaces regions of the Page's built-in layout (the left sidebar, the right sidebar, and the page header) with the content of a Snippet, or hides a region by setting it to false.

This property was previously named page-layout. That name is deprecated and still works, but it logs a warning to the browser console. Please rename page-layout to layout-options in your existing Portal Pages' front matter.

---
title: "Guides"
layout: "guide"
layout-options:
  sidebar-left: "guides-sidebar-left"
---

Which regions a Page can set depends on the layout it declares:

Layoutsidebar-leftsidebar-rightheader
guideyesyesyes
referenceyesnoyes
wideyesnoyes
centernonoyes
custom (default)yesyesno

On the custom layout, a sidebar region renders only the content of the Snippet named for it. On every other layout, the Snippet replaces the region's built-in content.

Setting a region the declared layout does not have has no effect. The browser console explains which regions the layout supports.

Setting a region the layout does have to false hides that region on the Page: the layout renders no built-in content and no Snippet there. The layout keeps its shape, so the content column keeps its position on guide and reference.

  • sidebar-left
  • sidebar-right

The sidebar regions allow you to configure a responsive "2 column" or "3 column" layout which is commonly used in Dev Portal documentation, guides etc.

You can choose to configure either of the sidebars independently (left or right), or choose to configure both for a 3-column layout. An example of the 3-column layout can be seen in the Dev Portal's API documentation pages.

Sidebars must refer to a Snippet. The content of each sidebar will be defined in the referenced Snippet.

Set a sidebar region to false to hide it. The Page then renders with no sidebar at all in that position: no Snippet, no navigation, and no table of contents. This is useful when a Page needs more room for its content.

---
title: "Guides"
layout-options:
  sidebar-left: false
---

A hidden sidebar shows no interactive APIs list filter either. Do not set a sidebar to false on a Page that uses show-filter.

On the guide, reference, and wide layouts, the left sidebar renders the navigation configured for your Portal. A Snippet named in sidebar-left replaces it. When nothing is configured for a route and the Page declares no Snippet, the left sidebar renders nothing. On guide and reference, its column stays reserved. On wide, the column collapses.

To clear the configured navigation for a section of Pages, without replacing it with a Snippet, configure a navigation entry whose show_on_path_prefixes includes the section's path, and pass an empty array as its groups. The entry claims the path and all of its child routes, so no navigation renders there, even when a broader entry such as / also matches the route:

{
  "data": [
    {
      "show_on_path_prefixes": ["/release-notes"],
      "name": "Release notes",
      "groups": []
    }
  ]
}

Usage

Page

In the example Page front matter below, the guides-sidebar-left and guides-sidebar-right refer to the name of the Snippets. Simply define the name of the desired snippet(s) in the layout-options property of the front matter.

---
title: Guides
layout-options:
  sidebar-left: "guides-sidebar-left"
  sidebar-right: "guides-sidebar-right"
---

Snippet

The guides-sidebar-left Snippet in this example would provide navigation between Pages, a typical layout pattern. Here's an example of the snippet content:

Notice we are defining a title property in the front matter of the Snippet. This is used to set the title of the sidebar navigation toggle button on smaller screens, set here to Guides.

---
title: Guides
---

::page-navigation
---
header: "Flights Information"
href: "/guides/flights"
children: true
---
::

The guides-sidebar-right Snippet in this example would provide a table of contents of sections within the current page, using the Page TOC component.

::page-toc
---
title: "On this page"
max-depth: 2
---
::
  • header

The guide, reference, wide, and center layouts render a built-in page header above the content, built from the Page's title, description, and tagline front matter. See Layouts for how the built-in header is composed.

A Snippet named in header replaces the whole built-in header, including the actions it renders. The Snippet renders in the same position, at the same width as the content column, so it cannot span the full width of the browser window. For a full-bleed header, use the custom layout.

---
title: "Release notes"
layout: "center"
layout-options:
  header: "release-notes-header"
---

Set header to false to render the Page with no header at all. The content starts at the top of the page, which is useful when the Page body supplies its own heading, such as a page-hero block:

---
title: "Release notes"
layout: "wide"
layout-options:
  header: false
---