Download the PHP package daun/statamic-multisite-field without Composer
On this page you can find all versions of the php package daun/statamic-multisite-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daun/statamic-multisite-field
More information about daun/statamic-multisite-field
Files in daun/statamic-multisite-field
Package statamic-multisite-field
Short Description Fieldtype for storing localized values in non-localizable contexts
License MIT
Homepage https://github.com/daun/statamic-multisite-field
Informations about the package statamic-multisite-field
Statamic Multisite Field
Fieldtype for entering localized values in places Statamic doesn't usually localize — asset blueprints, form configs, globals without localization, and other "site-less" contexts.
It wraps a single field of any type, stores one value per site, and augments to the current site's value on the frontend.
Installation
Usage
Add a multisite field to a blueprint and configure the field it wraps. Define display
and instructions on the root multisite field, not the wrapped field.
Frontend Display
Values are augmented to the current site's value on the frontend. Use like any other field.
Storage
Values are stored keyed by site handle.
Existing fields
Upgrading an existing field (e.g. text or url) to multisite just works:
previously stored values are treated as the default site's value and
upgraded to the per-site format on the next save.
Field Configuration
| Option | Default | Description |
|---|---|---|
field |
— | The wrapped field's configuration (required). |
layout |
tabs |
How to display the sites: one at a time behind a switcher (tabs, bottom, start, end) or all at once (stack). |
inherit |
true |
Fall back to the default site's value when a site has no own value. |
fallback |
— | Handle of a sibling field in the same publish context to fall back to when the default site has no value. |
Site Switcher Layout
In the control panel, the field shows the input for a single site at a time. Switch sites with the tabs above the field. All multisite fields on a page switch together, so you always see one consistent site across the form.
The layout field config controls how to switch sites.
Tabs
The default value of tabs shows a tab bar above the field.
Button Groups
The values bottom, start or end show a button group next to the field.
Stacked
The value stack shows all sites in a single column, without a switcher.
Inheritance
A multisite field can inherit from a sibling in the same blueprint, in addition to inheriting between its own sites. This is useful for adding optional per-site translations of a field that already has a default value.
Global Site Switcher
With many multisite fields on one form, the per-field switchers add up. Add a
multisite_switcher field to the blueprint to show a single global switcher
that controls all multisite fields. Any multisite fields on the same form will
then hide their own switchers.
Choose between three layouts: tabs, buttons or dropdown.
The switcher is a display-only field — it stores no data.
Limitations
- Listings and previews use the default site's value.
- Field conditions targeting the wrapped field are not supported.