Skip to main content

Switch the context for multiple renderings in a container

Abstract

Use context switching to set the data source for multiple renderings.

Context switching can be convenient when you want to change the data source for multiple renderings at the same time. If you assign a data source to the container rendering, all renderings within the container are rendered as if they were placed on that data source item. The default data sources set for the renderings do not change.

To add a container and to assign a data source:

  1. In the Experience Editor, from the toolbox, in the PageStructure group, click Container and drag it to the page.

  2. Add renderings to the container. For example, Title and Page content. By default, the renderings take the data source from the current page. For example, it shows the title and the page content of the product on the current page.

    Title and page content taken from data source example
  3. To change the data source for the renderings in the container, in the Container's floating toolbar, click Edit component properties.

  4. In the Control properties dialog box, in the General section, in the Data Source field, click Browse.

  5. You can now select a different data source for the renderings in the container.

    In the Select the Associated Content dialog you can select a different content item
    Example of how new data source content is loaded

    Important

    To switch the context for a container that contains a snippet, you must clear the Data Source field of the renderings within the snippet before assigning the different context.