Defining Layout Templates and Pages in a Sitemap

A sitemap defines the layouts—pages—and layout templates that your site or site template uses. Follow these steps to define pages and layout templates in your theme’s sitemap.json:

  1. Define a default layout template ID so the target site or site template can reference the layout template to use for its pages. When defined outside the scope of a page, the layoutTemplateId sets the default layout template for the theme’s pages:

    {
      "layoutTemplateId": "2_columns_ii",
      "publicPages": [
        {
          "friendlyURL": "/my-page",
          "name": "My Page",
          "title": "My Page"
        }
      ]  
    }
    

    You can override this by defining a layout template inside a page configuration. In the example below, the Hidden Page and the Welcome page both use the default 2_columns_ii layout template, while the Custom Layout Page overrides the default layout template and uses the 2_columns_i layout template instead:

    {
      "layoutTemplateId":"2_columns_ii",
      "publicPages": [
          {
            "friendlyURL": "/welcome-page",
            "name": "Welcome",
            "title": "Welcome"
          },
          {
            "friendlyURL": "/custom-layout-page",
            "name": "Custom Layout Page",
            "title": "Custom Layout Page",
            "layoutTemplateId": "2_columns_i"
          },
          {
            "friendlyURL": "/hidden-page",
            "name": "Hidden Page",
            "title": "Hidden Page",
            "hidden": "true"
          }
      ]
    }
    
  2. Follow the pattern below to specify the public and (optionally) private pages for your theme. You can specify a name for a page, title, friendly URL, whether it is hidden, and much more. The example below defines a default layout template and both public and private page sets to import into a site. See Sitemap Page Configuration Options for a full list of the available options.

            {
              "layoutTemplateId": "2_columns_ii",
              "privatePages": [
                  {
                    "friendlyURL": "/private-page",
                		"name": "Private Page",
                		"title": "Private Page"
                  }
              ],
              "publicPages": [
                  {
                    "friendlyURL": "/welcome-page",
                    "nameMap": {
                        "en_US": "Welcome",
                        "fr_FR": "Bienvenue"
                    },
                    "title": "Welcome"
                  },
                  {
                    "friendlyURL": "/custom-layout-page",
                    "name": "Custom Layout Page",
                    "title": "Custom Layout Page",
                    "layoutTemplateId": "2_columns_i"
                  },
                  {
                    "friendlyURL": "/hidden-page",
                    "name": "Hidden Page",
                    "title": "Hidden Page",
                    "hidden": "true"
                  }
              ]
            }
    

    You can create child pages by configuring the layouts element for a page configuration:

    {      
    "friendlyURL": "/parent-page",
    "layouts": [
        {
            "friendlyURL": "/child-page-1",
            "name": "Child Page 1",
            "title": "Child Page 1"
        },
        {
            "friendlyURL": "/child-page-2",
            "name": "Child Page 2",
            "title": "Child Page 2"
        }
    ],
    "name": "Parent Page",
    "title": "Parent Page"
    }
    

Great! Now you know how to configure pages for the Resources Importer.

« Creating a Sitemap for the Resources ImporterDefining Portlets in a Sitemap »
¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0