---
title: "Switch the context for multiple renderings in a container"
slug: "switch-the-context-for-multiple-renderings-in-a-container"
abstract: "Use context switching to set the datasource for multiple renderings."
---
# Switch the context for multiple renderings in a container

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.](https://doc.sitecore.com/api/markdown-image/xp/en/users/sxa/102/sitecore-experience-accelerator/images/SXA-container.png)

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.](https://doc.sitecore.com/api/markdown-image/xp/en/users/sxa/102/sitecore-experience-accelerator/images/SXA-change-datasource-dialog.PNG)

    ![Example of how different data source content is loaded](https://doc.sitecore.com/api/markdown-image/xp/en/users/sxa/102/sitecore-experience-accelerator/images/SXA-change-datasource.PNG)

    > [!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.