Using page templates

Page templates provide content editors with greater control over a page’s layout. Templates are prepared by the site’s developers and assigned by editors when creating new pages or changing the layout of existing pages. Depending on their implementation, page templates can combine means to display structured content (edited on a page’s Content tab) with predefined editable areas for page builder.

Page template types

Xperience supports the following types of page templates:

  • Default page templates – determine a page’s layout. Templates of this type first need to be created by the site’s developers.

  • Custom page templates – can be saved from pages that were created using default page templates. A custom page template inherits the page layout along with all page builder content used on the page. Inherited page builder content on pages created using these templates can be freely adjusted without impacting other pages – all modifications only affect the current page (there is no logical connection between the content of pages created with the same template).

    • Content edited on the Content tab of a page will not be saved in the custom template.

A typical use case for custom page templates is content reuse. After a developer defines a default page template, editors can create a page based on a default page template and populated the page with desired page builder content (e.g., a layout of widgets and sections in a configuration expected to occur repeatedly for that particular type of content). This page builder configuration can be reused on new pages by saving the page as a custom page template. With this approach editors can avoid repetitively duplicating a desired page builder layout over multiple pages. 

See Saving pages as custom page templates to learn how to create custom templates from default templates.

Creating pages based on page templates

To use page templates when creating pages:

  1. Ask a developer to define a default page template in code.

    See Developing page templates for developer instructions.

  2. As an editor, create a page based on a page template in the Xperience administration.

    Page templates may only be available for certain types of pages (or rely on other factors, such as the page culture and location within the content tree). The available template options depend on your site’s implementation.

  3. (Optional) Create content for the page you created in the previous step.

The page based on a page template is created. The editors can use this page to create a custom page template that will contain the content created on the page. See Saving pages as custom page templates.

Configuring page templates

You can configure a page template to further control the overall appearance of the page.

  1. Open the Pages application.

  2. Open a page based on a template and switch to the Page tab.

  3. Click the orange configure button () located in the bottom-left corner of the page window.

    Clicking the configure button

  4. Configure any available properties in the dialog.

    Configuring a page template

  5. Click Apply.

The configured properties now apply to the template for the given page. Any other pages that use the same template have their own separate property configuration. Depending on the available properties, the changes are reflected in the page’s appearance or behavior on the website.

Changing templates of existing pages

You can change the page template of an existing page, provided there is more than one page template available for the given page.

Content not preserved when changing templates

When changing the template of an existing page, all page content (i.e. widgets and sections with their data and properties) is lost. You should therefore change templates only in the early stages of page development. 

  1. Open the Pages application.

  2. Select a page based on a template and switch to the Page tab.

  3. Click the orange change template button () located in the bottom-left corner of the page preview window.

    Change template button.

  4. Select one of the available default or custom templates.

    Changing page template of an existing page

  5. Click Apply.

Saving pages as custom page templates

If you want to reuse page builder content, such as the layout of sections or content of widgets, you can save template-based pages as custom templates. Structured page data (edited on the Content tab of a page) is NOT saved within custom templates.

  1. In the content tree in the Pages application, navigate to a location where page templates are enabled.
  2. Create a new page based on an existing default template.
  3. Edit the page to add some content. You need to Save the edited page before you can proceed to the next step.
  4. Click the expand () button in the upper-right corner to show more actions and select Save as template. A dialog box opens.
      Expand button dialog
  5. Type a Template display name.
  6. (Optional) Add a Template description and upload a Thumbnail image for the template.
  7. Click Save.

You now have a custom template which you can select when creating new pages that support the original default template. Such pages automatically start with the page builder content stored within the custom template, and can then be further adjusted. Changes made in the content of one page do NOT affect the content of other pages that use the same custom page template.

Managing existing page templates

You can see a list of all custom page templates on your site in the Page templates application. In this application, you can Delete () custom page templates.

Page templates listing