Add a data source setting for an existing component

Current version: 10.4

Most SXA components are designed for reusability and pull data from data source items. This means that the content they display is not bound to the page on which they appear but is stored in data source items. Sometimes, you might want to add a field to the data source item of a component. For example, because you want to add a template field Image to the data source item of the Link component.

To add a data source setting to a component:

  1. First, create the new template. In the Content Editor, navigate to your site collection templates folder (sitecore/Templates/Project/) and insert the new template. This new data source item template must inherit from the existing SXA data source item template.

  2. In the Content Editor, navigate to sitecore/content/<site collection>/<site>/Settings/, right-click Datasource Configurations, click Insert, and click Datasource configuration.

  3. In the Create Datasource Settings dialog box, select the component that you want to create the data source setting for.

  4. In the Datasource configuration section, in the Datasource Template Item field, insert the new template.

  5. In the Datasource configuration section, in the Datasource Roots Locations field, specify the folder that contains the data sources.

    Note

    Consider creating a data source folder with your own insert options so that your editors can create them easily.

Do you have some feedback for us?

If you have suggestions for improving this article,