Skip to content

Sites and Site Groups

Ian DeRanieri edited this page Feb 8, 2018 · 6 revisions

Site Groups Model

Like field groups, site groups are used to organize different sites into logical groups that make sense for the website. These should be listed before the sites object.

The siteGroups object accepts an array of the Name of the site groups you want to create.

"siteGroups": [
    "languages"
  ],
Attribute Accepts Notes
{Array of site group names} Exists This site group will be created.

Sites Model

Each Sites object will create a site within the multi-site configuration.

"sites": [
  {
    "group": "languages",
    "name": "French",
    "handle": "french",
    "language": "fr",
    "primary": false,
    "hasUrls": true,
    "baseUrl": "@web/fr"
  }
]
Attribute Accepts Notes
group String This Site Group that this Site will belong to.
name String The name of this Site.
handle String The camelCased handle of this Site. Usually the camelCased version of the name, but not required.
primary Boolean Is this the primary Site for this Craft install?
hasUrls Boolean Does this Site have it's own urls?
baseUrl String This is the base url that allows the system to invoke this site. Prepend @web/ to use the system baseUrl in front of the site baseUrl.