Layout Data Model

Layouts in the current site.

Sample JSON Data

      {
        "data": {
          "type": "layouts",
          "id": "91e8a65f-4338-4a89-93e6-a4098d961a39",
          "attributes": {
            "title": "Product",
            "file-name": "product_layout.liquid",
            "description": "Product page.",
            "unique": false,
            "content": "<DOCTYPE html><html><head><title></title></head><body><header>{% region 'title' %}</header><main>{% region 'content' %}</main></body></html>",
            "head-parsed": "<title></title>",
            "body-parsed": "<header>{% region 'title' %}</header><main>{% region 'content' %}</main>",
            "pages-count": 5,
            "created-at": "2012-04-23T18:25:43.511Z",
            "updated-at": "2012-04-23T18:25:43.511Z"
          },
          "relationships": {
            "regions": {
              "data": [
                {
                  "type": "regions",
                  "id": "a63fc6ee-7292-46ee-a33a-0b75beedf7d2"
                },
                {
                  "type": "regions",
                  "id": "4d7f7547-b317-41b8-99bd-ef156784c1b3"
                }
              ]
            }
          }
        }
      }

Attributes

Attribute Type Required Description
title string Yes Title of layout.
file-name string Yes Name of layout file in theme’s layouts folder. Must have an extension of .liquid.
description string No A description of the layout that will appear within the Live Editor admin interface.
unique boolean No When true, this indicates that only 1 page on the entire site may be based on this layout. This value defaults to false.
content string Yes Content of layout. Can include Liquid markup relevant to layouts.
head-parsed string Read-only Content of <head> section of layout. May include Liquid markup relevant to layouts. This is auto-generated based on contents of the content attribute.
body-parsed string Read-only Content of <body> section of layout. May include Liquid markup relevant to layouts. This is auto-generated based on contents of the content attribute.
pages-count numeric Read-only Number of pages using this layout.
created-at date Read-only Timestamp recording when layout was created, localized to the current logged in user’s time zone.
updated-at date Read-only Date and time layout record was last updated, localized to the current logged in user’s time zone.

Relationships

Title Required Description
regions array Read-only Editable regions as defined via Liquid markup within the layout’s content attribute.

Related