Guide 01 · Developer docs

Choosing how to build

Decide where the pages of a Core dna site are composed before writing code: on the platform, in your own application, or on the platform with a few pieces filled in by the browser. The decision tree, each shape in depth, multi-brand and languages, and a table and case studies to make the call.

L2
Unit 05 · Multi-brand and multi-language

Several hostnames on one site, or several sites

The first multi-brand decision is structural: serve every brand from one site with several hostnames, or give each brand a site of its own. What each arrangement shares, and the questions that decide it.

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.example and www.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:

LevelRecordsWith several sites
ClientMember accounts and groups, files and foldersShared by every site of the client
SitePages and books, blogs, menus, rewrites and redirectsEach site has its own
EitherLayouts, global components, custom URLs, productsEach record belongs to one site, or to every site of the client

What each arrangement means

ConcernOne site, several hostnamesSeveral sites
Content sharingEvery 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 reuseEvery 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 accountsOne account per member, shared by every site of the client.The same: one account per member, shared by every site of the client.
ReportingOne set of figures for every brand; a per-brand figure needs a filter.Separate figures for each brand, without filtering.
Decide before content is entered

Pages, menus, blogs and rewrites belong to a site. Moving from one arrangement to the other means moving those records between sites, so settle the arrangement before editors start entering content.

The questions that decide it

Put these questions to the client before anything is built. No single answer decides; the pattern of answers does.

  1. Do the brands share most of their content? Pages, menus and blogs are per site. Mostly shared content favours one site; a separate tree per brand favours separate sites.
  2. Should an editor of one brand be unable to change another? Separate sites make that boundary structural.
  3. Is each brand reported on separately? Separate sites give separate figures without filtering.
  4. Should one account work for every brand? Accounts are shared by every site of the client with either answer, and a sign-in follows the domain with either answer, so this question does not decide between them.
  5. Must layouts and components be shared? They can be with either answer: on one site they are shared already, and across sites a layout or global component can belong to every site of the client.

Cache and sign-in follow the hostname

The page cache stores each page under the hostname of the request as well as its path, so two hostnames of one site never serve each other's cached pages. A template on a multi-hostname site can therefore branch on the hostname, and each brand still gets its own cached copy.

Member accounts are shared across the client's sites, and a sign-in holds for the hostname it was made on and that hostname's subdomains: a member who moves from one brand's domain to another signs in again. Plan any journey that crosses brands with that in mind.

The rest of this unit

With the arrangement chosen, Per-brand template folders shows how one template set serves every brand, starting from the value that names the brand. Languages and region follow, because they use the same mechanisms: records linked to each other, and rendering that respects the page cache.

Go deeper

Was this page helpful?

Your answer goes to the docs team.