Header switcher
What it does
The switcher in the header splits every list, count and search by object folder. Examples: sales markets (UK / DACH), or deal type (Sale / Rent). Pick an option, and objects in the folders of the other options are hidden. All shows everything. Objects outside the switcher's paths are shared and always shown.
Use it only when the content really lives in one folder per option, for example /Properties/Sale/… and /Properties/Rent/….
It is not a language switch. An item keeps all its languages; editors pick the language they edit with the language buttons in the editor. Split by market only when each market has its own items (the UK sells other tours than Germany), not when the same items are shown in two languages.
Default
No switcher.
Options
| Key | Default | What it does |
|---|---|---|
scope.label | Market | Name of the switcher. It is shown in each option's tooltip (Deal: Sale) and read out by screen readers. |
scope.options | {} | The choices: key: { label, locale, … } |
scope.paths | [] | Object paths, one per folder level, with {scope} where the option's folder is, e.g. /Tours/{scope}/ |
Per option:
| Option key | What it does |
|---|---|
| the key itself | The folder name, and the text on the button unless short is set (in capitals: en shows EN) |
short | Text on the button instead of the key, for a market whose folder has another name (folder en, button UK). Optional. |
label | The full name, shown in the tooltip. Default: the key in capitals. |
locale | Content language of this option. The editor opens localized fields in it. |
| any other key | An extra value you can use in website URLs as {scope.<name>}, e.g. site: 2 → {scope.site}, domain: … → {scope.domain} |
Every path needs `{scope}`
A path without {scope} is ignored. Without any valid path, the switcher stays off. keel:setup --check warns about it: keel.scope.paths: /Tours/ has no {scope}, so the switcher stays off.
Example
Real estate, split by deal:
keel:
scope:
label: Deal
options:
Sale: { label: Sale }
Rent: { label: Rent }
paths: ['/Properties/{scope}/']
Travel, one market per Pimcore site:
keel:
scope:
label: Market
options:
en: { short: UK, label: United Kingdom, locale: en, site: 1 }
de: { short: DACH, label: 'Germany, Austria, Switzerland', locale: de, site: 2 }
paths: ['/Tours/{scope}/', '/Reviews/{scope}/']
scope.options can also come from a container parameter that the project already has, e.g. options: '%app.markets%'.
How users see it
Each user's choice is remembered in their browser.
What admins change in Customize
Nothing. The switcher is set in keel.yaml only.