1. Modules

Add modules to site and site collection scaffolding

Version:

Scaffolding lets you add modules to sites and site collections. SXA modules are stored in the Feature or Foundation folder:

  • /sitecore/System/Settings/Foundation/Headless Experience Accelerator/
  • /sitecore/System/Settings/Feature/Headless Experience Accelerator/

To define your new module, you must add the Site Setup, Site Collection Setup, or Grid Setup item to the module and add action types from the Scaffolding folder (sitecore/Templates/Foundation/Headless Experience Accelerator/Scaffolding/).

Add a module scaffolding definition

To add your own module scaffolding definition:

  1. Navigate to /sitecore/System/Settings/Foundation/ or /sitecore/System/Settings/Feature/ and add a folder.

  2. Right-click the new folder, and click Insert from template.

  3. In the Insert from template dialog box, navigate to sitecore/Templates/Foundation/Headless Experience Accelerator/Scaffolding/Roots and, depending on the type of module that you want to add, click Headless Site Setup or Headless Site Collection Setup, and then click Insert.

    Add new site setup.
  4. In the Data section, depending on the type of module that you want to install, fill in the following fields:

    SetupFieldDescriptions
    Headless Site SetupNameThe name of the site module as you want it to display in the site creation wizard.
    DependenciesSpecify the order in which the modules are installed.
    Include by defaultSelect to enable the module by default in the site creation wizard.
    Include if installedDepending on whether the selected action was applied to the current site collection, the module will be automatically included.

    If the Selected field is empty, you can decide whether to install this module in the new-site creation wizard.
    Is system moduleSelect to install the module automatically. In this case, the module does not appear in the dialog box.
    Headless Site Collection SetupNameThe name of the site collection module as you want it to display in the site collection creation wizard.
    Include by defaultSelect to enable the module by default in the site collection creation wizard.
    Is system moduleSelect to install the module automatically. In this case, the module does not appear in the site colleciton creation wizard.

Add scaffolding actions

You can use various action types to define modules. You can add items, edit the template, and execute PowerShell scripts. The available actions are stored in the Actions folder (sitecore/Templates/Foundation/Headless Experience Accelerator/Scaffolding/Actions):

Scaffolding actions

To add a scaffolding action:

  • Navigate to your new module and right-click the setup item that you added for your new module. For example, right-click the Headless Site Setup item and insert the Add Headless Site Item action.

    Add Site item

The following actions are available:

  • Action type: Field
  • Add Headless Site Collection Item: Location
  • Template: Template used to create the new site collection item.
  • Name: Name of the item.
  • Fields: Field/value mapping to set the fields of the new item after creation.
  • Edit Headless Site Collection Template: Template
  • Type of action: Select the action type.
  • Base templates or insert options templates: Select items to use as an argument for the action selected in the previous field.
  • Execute Headless Site Collection Script: Script
  • Add Headless Site Item: Location
  • Template: Template used to create a new site item.
  • Name: Name of the new site item.
  • Fields: Field/value mapping to set the fields of the new item after creation.
  • Edit Headless Site Item: Template
  • Type of action: Select the action type.
  • Insert options: Define the insert options for the item.
  • Execute Headless Site/Site Collection Script: Script
  • Post Setup Step: Script
  • Input Validation Step (site): Script
  • Post Setup Step: Script
  • Input Validation Step (site collection): Script
  • Pre Delete Step: Script
  • Post Delete Step: Script
  • Pre Delete Validation Step:
If you have suggestions for improving this article, let us know!