Statamic Multi-Site Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Statamic Multisite Setup

Statamic Pro supports multiple sites from one installation with different domains, languages, and content sets. Content can be shared across all sites or unique to each.

Sites Configuration

// config/statamic/sites.php
return [
  'sites' => [
    'default' => [
      'name'     => 'My Site RU',
      'locale'   => 'ru_RU',
      'url'      => env('APP_URL', '/'),
      'direction' => 'ltr',
      'attributes' => ['lang' => 'ru'],
    ],
    'english' => [
      'name'   => 'My Site EN',
      'locale' => 'en_US',
      'url'    => env('SITE_EN_URL', 'https://mysite.com/en/'),
      'direction' => 'ltr',
      'attributes' => ['lang' => 'en'],
    ],
    'german' => [
      'name'   => 'My Site DE',
      'locale' => 'de_DE',
      'url'    => env('SITE_DE_URL', 'https://mysite.com/de/'),
    ],
  ],
];

Collections Localization

# content/collections/blog.yaml
sites:
  - default
  - english
  - german

Localized entries are stored in folders by site handle:

content/collections/blog/
├── default/
│   └── my-post.md           # Russian version
├── english/
│   └── my-post.md           # English version
└── german/
    └── my-post.md           # German version

If a localized version is not created, Statamic shows fallback to the main site.

Globals with Localization

# content/globals/site.yaml (default)
title: My Site
phone: +7 999 123-45-67
footer_text: © 2024 My Site

# content/globals/site/english.yaml (override for en)
title: My Site
phone: +44 20 1234 5678
footer_text: © 2024 My Site

Language Switcher in Antlers

{{# List versions of current page #}}
{{ if entry }}
    {{ collection:sites }}
        {{ if sites_enabled }}
            {{ foreach:localizations as="locale => localized_entry" }}
                {{ if localized_entry }}
                    <a href="{{ localized_entry:url }}"
                       lang="{{ locale }}"
                       {{ if locale == {current_site:handle} }}aria-current="page"{{ /if }}>
                        {{ site:name }}
                    </a>
                {{ /if }}
            {{ /foreach:localizations }}
        {{ /if }}
    {{ /collection:sites }}
{{ /if }}

Simplified via helper:

{{ locales }}
    <a href="{{ url }}" lang="{{ locale }}" {{ if is_current }}aria-current="page"{{ /if }}>
        {{ name }}
    </a>
{{ /locales }}

PHP Queries with Site Context

use Statamic\Facades\Entry;
use Statamic\Facades\Site;

// Entries of current site
$posts = Entry::query()
    ->where('collection', 'blog')
    ->where('site', Site::current()->handle())
    ->get();

// Entries of specific site
$enPosts = Entry::query()
    ->where('collection', 'blog')
    ->where('site', 'english')
    ->get();

SEO: hreflang Tags

{{# In <head> layout #}}
{{ if entry }}
    {{ locales }}
        <link rel="alternate"
              hreflang="{{ locale }}"
              href="{{ url }}">
    {{ /locales }}
    <link rel="alternate" hreflang="x-default" href="{{ entry:url }}">
{{ /if }}

Setting up multisite with 2–3 languages — 1–2 days.