1. Components

Use the Component wizard to create a custom rendering

Version:

With SXA, you can quickly create a copy of an SXA rendering by using the clone script. This can be convenient, for example, if you want many Promo renderings that are all styled differently. If you want to create a custom rendering that is not similar to an existing rendering, you can also use the Component wizard.

Because the standard SXA toolbox sections are overwritten with SXA updates, we recommend that you create a separate toolbox section for derivative renderings. You can do this by adding a new module to SXA.

Note

If you are running your Sitecore XP instance in a container, do not use the following method. Instead, create SXA modules and containers in a local development environment, and deploy them to the container as a custom image.

To create a custom rendering using the Component wizard:

  1. In the Content Editor, navigate to sitecore/Layout/Renderings/Feature/ and create a folder for your custom rendering. This ensures that your rendering is not overwritten during SXA updates.

  2. Right-click the folder that you just created, click Insert, and click Component.

  3. In the wizard, fill out the following fields:

    TabFieldDescription
    GENERALComponent nameEnter the name for the new rendering.
    Add to moduleSelect the module the new rendering belongs to.
    Rendering CSS classEnter the CSS class for the rendering.
    Path to rendering viewBy default, the view name in SXA is resolved as the rendering definition item name. To provide a custom path, enter the location of the view here.
    DATASOURCEDatasourceDetermine the data source origin by selecting one of the following options:

    • Use current page - data source item reads data from the current page.
    • Ask user for data source - lets the content editor choose the data source.
    • Automatically create data source under page - stores the data source as a page relative data source item under a given page.
    Rendering templateSelect the template.
    Base rendering parameters templateSelect the base template. By default, the Standard Rendering Parameters template is selected.
    Base data source templateSelect the data source template to specify the types of data sources users can create.
    Publishing grouping templateHelps with publishing complex data source structures that have children, for example, Carousel, Tabs, Link List, and Gallery. Can only be used if Publishing Service is enabled.
    Additional compatible templatesEnables you to select multiple templates for the data source. For example, for the Promo rendering, you could use the Promo templates but also other data sources, such as Text and Image.
    BEHAVIORSSelect Page as a data sourceLets you use a page as a data source. Select this option if you want the component to take content from the current page.
    Background imageEnables you to add a background image for the component. It will add a base template to your data source template that contains a field that lets editors pick an image used as background.
    Select data source behaviorDetermines whether users can set data source behavior.
    Component variantsDetermines whether the rendering can have variants.
    Dynamic placeholdersEnables a dynamic placeholder for a rendering.
If you have suggestions for improving this article, let us know!