Switch the context for multiple renderings in a container

Current version: 10.2

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 Page Structure 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.

  3. To change the data source for the renderings in the container, in the Container's floating toolbar, click Edit component properties.

    Click More and 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.

    Select the Associated Content dialog box.
    Example of how different 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.

Do you have some feedback for us?

If you have suggestions for improving this article,