Who this is for. The architect or lead developer starting a project that serves several brands, regions or languages from one codebase. After this page you can put the structural question to the client as a checklist, and you know what each answer commits the project to.
Serving several brands from one codebase is an overlay on any build shape, not a shape of its own. Its first decision is structural and expensive to reverse, because content is stored per site. The template techniques in the rest of this unit work with either answer.
Client, site, environment, hostname
The platform arranges every project in four levels. A client has one or more sites. A site has environments, such as development, staging and production. An environment has one or more hostnames. A hostname belongs to exactly one environment and is unique across the whole platform.
Several brands therefore fit one of two arrangements:
- One site, several hostnames. The production environment carries
www.brand-one.exampleandwww.brand-two.example, and every hostname serves the same pages, menus and blogs. Templates tell the brands apart by the hostname of the request. - Several sites. Each brand is a site of its own under the same client, with its own environments, hostnames and content.
What is shared at each level
Each record type belongs to a level, and the level decides what brands on separate sites can share:
| Level | Records | With several sites |
|---|---|---|
| Client | Member accounts and groups, files and folders | Shared by every site of the client |
| Site | Pages and books, blogs, menus, rewrites and redirects | Each site has its own |
| Either | Layouts, global components, custom URLs, products | Each record belongs to one site, or to every site of the client |
What each arrangement means
| Concern | One site, several hostnames | Several sites |
|---|---|---|
| Content sharing | Every brand serves the same pages, menus and blogs. Differences are made in templates and in per-brand global components. | Each brand has its own pages, menus and blogs. Shared pieces are global components or products that belong to every site of the client. |
| Layout reuse | Every layout and component is shared by every brand. | Layouts and global components are shared when they belong to every site of the client; a layout for one brand belongs to its site. |
| User accounts | One account per member, shared by every site of the client. | The same: one account per member, shared by every site of the client. |
| Reporting | One set of figures for every brand; a per-brand figure needs a filter. | Separate figures for each brand, without filtering. |