Marking regions on a Web page

By marking regions on a Web page, you make explicit to the User Interface which combinations of a Schema and a Component Template are allowed in such regions. This affects where new Component Presentations are added, and how users can move Component Presentations around on the Web page.

About this task

For this functionality to work properly, your Page Template must meet the following requirements:

  • The Page Template must contain logic that groups Component Presentations on the Web page based on Component Presentation type. A Component Presentation type is here defined as a combination of a Schema and a Component Template. If two Component Presentations are of the same Component Presentation type, the Page Template must place them in the same region.
  • The Page Template must render each such group inside a distinct HTML container tag (typically <div>) on the published Web page, which we here call a region.

If your Page Template does not meet these requirements, do not perform this task. Refer to the templating topics in the documentation portal for SDL Tridion to learn more about organizing Component Presentations by Component Presentation type in your Page Template.

Procedure

  1. In Template Builder, open a Page Template that meets the requirements listed above.
  2. Determine which regions on the Web page 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. Now 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.

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