Site Picker

Site Picker

Tools for working with multiple site definitions

The sitePicker component provides tools for working with Multisite configuration for your website. The best place to include this is in your page or layout template.

# Basic Usage

{% set availableSites = sitePicker.sites %}

The following is an example of displaying a dropdown that switches between sites. It is used in conjunction with the Twig property.

<select class="form-control" onchange="window.location.assign(this.value)">
    {% for site in sitePicker.sites %}
        <option value="{{ site.url }}" {{ == site.code ? 'selected' }}>
            {{ }}
    {% endfor %}

Another example is generating alternative page links using meta tags

{% for site in sitePicker.sites %}
    <link rel="alternate" hreflang="{{ site.locale }}" href="{{ site.url }}" />
{% endfor %}
On This Page