Discussing the SAP Commerce Cloud WCMS Page Model

Objective

After completing this lesson, you will be able to explain the WCMS Page Model, its structure, components and their relationships

The Simplified Web Content Management System (WCMS) Page Model

Laura would like to create pages and populate their content slots with components (such as images or text paragraphs), as shown in the next diagram:

Diagram showing the structure of a page with marked content slots. Components such as banners, paragraphs or images can be put into those content slots.

However, this simplified approach has some major drawbacks, because Laura would be responsible for defining the page structure and slot locations for every page individually – resulting in tedious and error-prone extra work.

Instead, we use the concept of templates:

Each template defines a dedicated page structure and amount of content slots. Out of the box, SAP Commerce Cloud already provides a useful selection of templates, and developers can create additional custom templates.

Every page in WCMS has a page template assigned to it that defines its layout and visual structure. While quite complex layout options are possible, most out-of-the-box templates have two- or three-column layouts. Page templates also define the number of usable content slots. Each content slot can be populated by zero, one or many visual components such as a button or banner. ​

This concept is visualized in the next diagrams:​

Several page templates side-by-side: 2-column template, 3-column template, and other templates.

When Laura creates a page, she selects a template to apply a specific page structure. Every page in WCMS is mapped to exactly one page template, but one template can give its structure to any number of pages.​

In our example, Laura creates the Homepage and Company Profile pages, both derived from the 2-column template, while the Product Details page is derived from the 3-column template, as you can see in the following diagram:​

Image shows how Homepage and Company Profile Page are derived from the 2-column template, while the product details page is derived from the 3-column template.

As mentioned, each page derives the number and positions of its content slots from its assigned template, visualized in the following simplified diagram:​

Image shows how the Homepage and Company Profile Page, including their content slots, are derived from the 2-column template, while the product details page is derived from the 3-column template, also with the corresponding content slots.

As mentioned, content slots can be populated with components – otherwise, they remain invisible on the storefront. A CMS component is the smallest piece of information that can be managed in WCMS.​

Laura can choose from two types of components:​

  • Simple components

    (for example, image, paragraph)

  • Complex components

    (for example, banner, link, product carousel)

You might wonder whether Laura can add just one component to a content slot? Of course not, this would be far too limiting! She can add any number of components to a content slot, and they're automatically aligned in the proper order within a layout based on their preferred sizes. Of course, there are different-sized slots, as you've seen on the previous diagram, and it makes sense to choose a roughly matching slot for a component to look good.​

As shown in the previous diagram, the Homepage and the Company Profile page share the same two-column template. What makes these pages look different is the components added to their content slots.​

Laura can add images and paragraph components to the different content slots of her newly created homepage, shown in the following diagram.​

The image shows how 2 derived content slots on the Homepage shall be populated with image and paragraph components. It also shows how the Homepage and Company Profile Page are derived from the 2-column template, and the product details page is derived from the 3-column template.
The image shows how 2 derived content slots on the Homepage are actually populated with image and paragraph components. It again shows how the Homepage and Company Profile Page are derived from the 2-column template, and the product details page is derived from the 3-column template.

Note

It's important to understand that page templates and pages don't define content shown on the web site. They merely define the structure of the page via a page template with the respective content slots of that template. The components placed in those content slots are responsible for providing content, either by creating it directly or by identifying the data source that will provide it. ​

But that isn't all. ​

Imagine Laura has dozens of pages derived from the 2-column template (such as the homepage), but now she needs to add a banner with her company logo. By adding it to a content slot on each page, she would have to modify every page individually, which is cumbersome and error-prone.​

The good news is, content slots can have a page scope, as we already introduced. Alternatively, they could provide a template scope. We refer to those slots as shared slots. ​

In our example, a single shared slot derived from the 2-column template will solve Laura's problem: ​She can add the company logo there, and it will automatically show up on all pages derived from that template. In essence, this shared slot exists only once but is shared between many pages.​

Two different types of content slots exist, based on their scope:​

  • A shared slot lives at the template level and displays the same components on every page that uses that template.

    Perfectly suited for showing/editing a single component on all affected pages.

  • A page slot is also derived from a template but lives on the page level. Each page slot might contain a different component on each page.

    Best suited for showing/editing components that are only visible locally on a specific page.

Templates provide a healthy mix of shared and page slots to support business users choosing the right scope for their components.​

Let’s summarize: Instead of adding the logo to each page slot individually, Laura can save a lot of time by using just one shared content slot. A shared slot lives at the template level; thus, each page derived from this template will display the logo.

Let’s see the result in the next diagrams.

The image shows how the company logo shall be added to a shared slot directly defined on the 2-column template. It also shows the 2 previously derived content slots on the Homepage, which were actually populated with image and paragraph components.

Laura adds the logo component to the shared slot of the 2-column template.​

The image shows the company logo now added to a shared slot directly defined in the 2-column template.

After Laura adds the logo component to the shared slot of the 2-column template, the derived Home page and Company Profile Page will automatically look like this:​

The image shows the company logo now added to a shared slot, directly defined in the 2-column template, and automatically becomes visible on pages derived from that template. It again shows the 2 previously derived page content slots on the Homepage, which were actually populated with image and paragraph components.

The banner component was added to a shared slot defined by the 2-column template. Thus, it becomes visible on the Home and Company Profile pages, which reference this template. Exchanging the banner with a different component will instantly affect all pages referencing the modified shared slot.​

The paragraph and image components on the other hand were added to page slots and are displayed on different local pages. Exchanging one of these components with a different one would affect only the modified page itself.​

Summary

  • Every page in WCMS has a page template assigned to it that defines its layout and visual structure.
  • Page templates define the number of usable content slots.
  • Each content slot can be populated by zero, one or many visual components.
  • Web components are added to either a page-scoped content slot or a shared content slot.
  • While a component in a page content slot is only visible on that current page, a component added to a shared slot becomes visible on all pages derived from the slot holding template.
  • Further reading: SAP Commerce Cloud Documentation: Overview of the CMS Data Model