Define stack meta-data in stack.json

The stack.json file, located in the /stack/<stack-type> directory, defines meta-data for a stack.

An example of a stack.json file is provided below:

{   
   "availableToAllPages": true,
   "configurable":false,
   "configuration": {},
   "name": "Accordion Container",
   "regions": [
     {
       "name": "Accordion 1",
       "width": 12
     },
     {
       "name": "Accordion 2",
       "width": 12
     }
   ],
   "stackType": "accordionContainer",
   "styleSettings": {},
   "version": 1
 }

The following list describes all the properties that you might choose to include in a stack.json file.

  • availableToAllPages: Set this property to true to allow the stack to be placed on all page types; the stack will appear in the Component library for all pages. Omit this property altogether to restrict placement of the stack to the page types defined in the pageTypes property. Note that this property and the pageTypes property are mutually exclusive but one of them must be set.
  • pageTypes: Defines which page types the stack can be placed on; the stack will appear in the Component library for the specified pages. If you use this property, you must omit the availableToAllPages property. Note that this property and the availableToAllPages property are mutually exclusive but one of them must be set.

    Available page types include:

    • product
    • category
    • home
    • cart
    • checkout
    • confirmation
    • article
    • error
    • searchResults
    • noSearchResults

    The stack will appear in the Component library for the page types you specify.

  • configurable: Set this property to false. It is for future use.
  • configuration: Leave this array empty. It is for future use.
  • name: Defines the display name for the stack in the component library.
  • regions: An array that defines the default sub-regions that are available within the stack when a new instance of this stack is created. Each item in the array includes the following properties:
    • name: The display name of the default region.
    • width: This property is required to pass validation and should be set to 12.
  • stackType: A unique identifier for the stack.
  • styleSettings: Leave this array empty. It is for future use.
  • version: The numeric version of the stack.