Skip to content

System Configuration

The system.json file configures various website settings, including page routing, content management, and other system-level parameters. It acts as a central hub for managing essential aspects of your site's functionality and structure, ensuring seamless integration and control.

Page Routes

The pageRoutes The attribute specifies the routing configuration for different pages on the website, determining how URLs are mapped to specific content or templates. This setup ensures that requests to particular URLs are directed to the appropriate page, facilitating seamless navigation and content rendering.

Properties:

Attribute Type Required Description Default
title String No Title of the page.
path String Yes Human-readable name of the route.
page String No Name of Page Resource.
method String Yes HTTP method used for the route (e.g., GET, POST). GET
authorize Bool No Indicates whether authorization is required.
debug Bool No Indicates if debug mode is enabled.
systemFunction String No System function associated with the route, if any (e.g., Login, Logout, Checkout).
metaObjects Array No Array of meta objects for additional processing.
contentType String No Specifies the content type of the response.
redirectPath String No Redirect Path
name String Yes URL path associated with the route

Meta Object Attributes

Attributes Type Required Description Default
name String Yes Name of the meta object. -
sdk Object No Defines the SDK configuration for fetching data. -

SDK Attributes

Attributes Type Required Description Default
route String Yes SDK route used to fetch data. -
parameters Array(Object) No Array of parameters for the SDK route. -
method String No HTTP method for the SDK request (e.g., GET, POST). GET
useContextQueryString Boolean No Indicates if the context should be added to the query string. true

SDK Parameter Attributes

Attributes Type Required Description Default
name String Yes Name of the parameter. -
valueOrigin String Yes Origin of the parameter's value (e.g., UrlParam, Setting). -
required Boolean No Indicates if the parameter is required. false

GET Route

Example: Get route serving up index.json

{
  "pageRoutes": [
    {
      "path": "/",
      "title": "Experience Builder Dev",
      "page": "index.json",
      "method": "GET",
      "authorize": false,
      "debug": false
    }
  ]
}

POST Route

Example: The post route handles form submissions, passing the data to an SDK function for processing. If the SDK command executes successfully, it triggers the system's "Login" function, allowing the user to authenticate. Upon successful login, the route then redirects the user to the /customer page, ensuring a smooth and secure transition to the next step in the workflow.

{
  "pageRoutes": [
    {
      "path": "/account/login",
      "method": "POST",
      "authorize": false,
      "systemFunction": "Login",
      "redirectPath": "/customer",
      "metaObject": {
        "name": "Login",
        "sdk": {
          "route": "customer/login",
          "type": "LoginInfo"
        },
        "returnType": "Customer"
      }
    }
  ]
}

Exceptions

The exceptions The attribute enables you to define custom behavior for various HTTP exception codes.

Properties:

Property Description Required Default
code HTTP exception code. Yes
routeId Route ID to handle the exception, must be a 32-character hexadecimal string. Yes

Example:

{
  "exceptions": [
    {
      "code": 404,
      "routeId": "1cb6b732636249357b6bf1d16dad26b5"
    }
  ]
}

Authentication

The authentication attribute configures settings for identity cookies.

Properties:

Property Description Required Default
allowRefresh Allows cookie refresh. Yes
isPersistent Sets the cookie as persistent. Yes
expirationLength Length of time the cookie is valid. Yes

Example:

{
  "authentication": {
    "identityCookie": {
      "allowRefresh": true,
      "isPersistent": false,
      "expirationLength": 3600
    }
  }
}

Default Locale and Market

The defaultLocale and defaultMarket properties specify the default locale and market.

Example:

{
  "defaultLocale": "en-US",
  "defaultMarket": "US"
}