Localizing Navigation

Hot Tip!

You can use the php please multisite to automate converting from a single to a multisite installation.

Defining Sites

To choose which sites the navigation will be available in, just make sure the file exists in the respective sites' directories as described below.

Folder Structure

The folder structure will differ from the single site structure explained in the navigation guide. Now, navs should be organized into the respective sites.

The tree array will also be relocated into separate files organized into sites. The meta level information will remain in the existing YAML file.

content/navigation/
nav.yaml
site-one/
nav.yaml
site-two/
nav.yaml
Hot Tip!

A navigation will be considered unavailable for a particular site if a file doesn't exist in its subdirectory.

Trees

The navigation file itself will continue to be responsible for defining things like its name, route, etc.

The "tree" defines the pages and their layout. The tree is what is localized to each site.

# nav.yaml
title: Nav
root: true
collections:
- pages
- articles
# site-one/nav.yaml
tree: [...]
# site-two/nav.yaml
tree: [...]
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →