Marking Regions on a webpage

By marking Regions on a webpage, you make explicit to Experience Manager which content is allowed where on the webpage. This affects where new Component Presentations can be added, and how users can move Component Presentations around on the webpage.

About this task

For this functionality to work properly, your Page must meet the following requirements:
Pages with a Page Schema
If your Page has a Page Schema, the Page Schema defines the Regions of the Page. In the Page Template, you designate various HTML containers (typically <div> sections) as corresponding to each of the Regions using the path property.
Pages without a Page Schema
If your Page does not have a Page Schema (a deprecated practice), the Page Template must define the Page Regions instead, specifically for Experience Manager. In this setup, the Page Template itself defines each Region, through a title, as well as through a list of one or more Component Presentation types allowed within it. A Component Presentation type is a combination of a Schema and a Component Template. That means that if two Component Presentations are of the same Component Presentation type, the Page Template must place them in the same region. Refer to the templating topics to learn more about organizing Component Presentations by Component Presentation type in your Page Template. You place the title and list of Component Presentation types in the various HTML containers (typically <div> sections) that you want to represent each of the Regions on your Page.

Procedure

  1. In Template Builder, open a Page Template that meets the requirements listed above.
  2. Determine which areas of the webpage you would want to make modifiable. Typically, these would be <div> sections on the page; they must be some type of HTML container element.
  3. If the Pages rendered with this Page Template have a Page Schema, ensure that your Page Template adds an HTML comment like the following inside each such container element:
    <!-- Start Region: {
      title: "PATH\TO\REGION"
    }
    -->

    where PATH\TO\REGION is the fully qualified name of a Region whose contents you want to place in this area, represented as a Region path. For example, to refer to the root-level Region called foo, set the value of title to foo; to refer to the second-level Region called sidebarEntry within the root-level Region called sidebar, set title to sidebar\sidebarEntry.

  4. Alternatively, if the Pages rendered with this Page Template do not have a Page Schema, ensure that your Page Template adds an HTML comment like the following inside each such container element:
    <!-- Start Region: {
      title: "My Region",
      allowedComponentTypes: [
        {
          schema: "tcm:2-26-8",
          template: "tcm:2-32-32"
        },
        {
          schema: "tcm:2-27-8",
          template: "tcm:2-32-32"
        }
      ],
      minOccurs: 1,
      maxOccurs: 5
    }
    -->

    in which the following items can be modified:

    title
    A unique and meaningful title for this region. The end user sees this title while working with the region.
    allowedComponentTypes

    An array of schema and template pairs. Your Page Template should only put Component Presentations in the region if they match one of these pairs.

    The schema property is the Content Manager URI of a Schema on which Components in this region may be based. The template property is the Content Manager URI of a Component Template with which Components based on such a Schema can be rendered. In the Content Manager, the Schema you specify must be listed as one of the Allowed Schemas of the Component Template you specify.

    The same schema value may occur multiple times in this region, combined with different template values; and the same template value may occur multiple times in this region, combined with different schema values. But a specific combination of schema and template values can occur only in one region.

    minOccurs

    The lowest number of Component Presentations that you allow in this region. Omit this property to indicate that you impose no lower limit on the number of Component Presentations in this region.

    maxOccurs

    The highest number of Component Presentations that you allow in this region. Omit this property to indicate that you impose no upper limit on the number of Component Presentations in this region.

  5. Save and close the Template Building Block(s) you modified, and republish them to create the regions on the published webpage.