Sites¶
Runs many sites from one Drupal installation, like Valtora's corporate site,
the brand sites Hydrion and Torqline and Hydrion's country sites. It finds the
site of each request by its hostname, gives every site its own settings and
per-site roles, and answers "Not Found" on a site's hostname for the content
of other sites. Every site is built from a
site type that decides which settings, content
and roles its sites offer. drush en sites also enables
Sites UI; sites created in the admin UI need
Sites content as well
(Installation).
Install¶
A project of its own, drupal.org/project/sites:
composer require drupal/sites
drush en sites
Requires Environment Context, form_decorator (form_decorator), views_query (views_query).
Configure¶
- Sites configuration > Site types (
/admin/sites/types): one type per kind of site, with a matrix per settings area that decides what its sites set themselves, per environment, per language or by inheritance (Site types). - Each site's Identity section holds its hostname, structure, region and canonical link, its Inheritance section the site it inherits values from (Create a site). The other settings below are sections on the site's dashboard (Site settings), combined in layers.
settings.phplists the hostnames intrusted_host_patterns(Trust the hostnames) and can pin any setting on a server (settings.php).
The platform-wide switches on Sites configuration > General come with Sites UI.
Settings¶
The setting plugins it adds, with their keys on Site settings:
- Identity (
sites) - Inheritance (
inheritance) - Site information (
system_site) - Appearance (
appearance) - Assignable content (
content) - Auto-assigned content (
content_defaults) - Site filtering (
site_filtering) - Assignable roles (
roles)
Permissions¶
| Permission | Machine name |
|---|---|
| Access disabled sites | access disabled sites |
| Add Content block: Basic block content to a site | add block_content:basic content to site |
| Add Content: Article content to a site | add node:article content to site |
| Add Content: Basic page content to a site | add node:page content to site |
| Add Media: Audio content to a site | add media:audio content to site |
| Add Media: Document content to a site | add media:document content to site |
| Add Media: Image content to a site | add media:image content to site |
| Add Media: Remote video content to a site | add media:remote_video content to site |
| Add Media: Video content to a site | add media:video content to site |
| Add Taxonomy term: Tags content to a site | add taxonomy_term:tags content to site |
| Add llms.txt section content to a site | add llms_txt_section content to site |
| Add content to a site | add content to site |
| Add existing users to a site | add user content to site |
| Administer sites | administer sites |
| Administer sites configuration | administer sites configuration |
| Manage site members | manage site members |
| Manage site settings | manage site settings |
| Remove Content block: Basic block content from a site | remove block_content:basic content from site |
| Remove Content: Article content from a site | remove node:article content from site |
| Remove Content: Basic page content from a site | remove node:page content from site |
| Remove Media: Audio content from a site | remove media:audio content from site |
| Remove Media: Document content from a site | remove media:document content from site |
| Remove Media: Image content from a site | remove media:image content from site |
| Remove Media: Remote video content from a site | remove media:remote_video content from site |
| Remove Media: Video content from a site | remove media:video content from site |
| Remove Taxonomy term: Tags content from a site | remove taxonomy_term:tags content from site |
| Remove User content from a site | remove user content from site |
| Remove llms.txt section content from a site | remove llms_txt_section content from site |
| Remove content from a site | remove content from site |
| View foreign site assignments | view foreign site assignments |
| View unassigned content | view unassigned content |
Admin pages¶
| Path | Title |
|---|---|
/admin/sites/add-content/{entity_type_id} |
|
/admin/sites/change-canonical/{entity_type_id}/{entity} |
Change origin site |
/admin/sites/content-action/add_to_site |
Add to site |
/admin/sites/content-action/remove_from_site |
Remove from site |
/admin/sites/content-action/set_canonical_site |
Set origin site |
/admin/sites/create/{entity_type_id}/{bundle} |
|
/admin/sites/remove/{site}/{entity_type_id}/{entity} |
Remove content from site |
/admin/sites/{site}/appearance |
Appearance |
/admin/sites/{site}/identity |
Identity |
/admin/sites/{site}/inheritance |
Inheritance |
For developers¶
Drush: sites:create, sites:delete, sites:disable, sites:enable, sites:info, sites:list.
Agent tools: sites:assign_content, sites:current_site, sites:entity_access, sites:entity_sites, sites:site_arrange, sites:site_config_override_set, sites:site_config_overrides, sites:site_create, sites:site_delete, sites:site_list, sites:site_member_roles_set, sites:site_members, sites:site_set_enabled, sites:site_settings, sites:site_settings_set, sites:unassign_content.
Last updated 2026-10-16