Visitar URL original
Sites pane by brandonkelly · Pull Request #20061 · craftcms/cms · GitHub
Skip to content

Sites pane - #20061

Merged
brandonkelly merged 9 commits into
5.12from
feature/sites-pane
Oct 22, 2026
Merged

brandonkelly merged 9 commits into
5.12from
feature/sites-pane

Conversation

@brandonkelly

@brandonkelly brandonkelly commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Adds a “Sites” pane to element editor sidebars, which replaces the “Status” pane for localized element types on multi-site installs.

The Sites pane:

  • Lists the sites the element is saved to that the user can edit, with the current site first (marked with a checkmark). If there are 2+ other sites, they’re listed within an “X other sites” disclosure.
  • Links each site name to the element’s edit page in that site. Within element editor slideouts, clicking on a site name switches the slideout to that site instead (saving any pending draft changes first, or confirming that unsaved changes will be lost, for element types that don’t autosave drafts).
  • Includes a status toggle for each site, if the element type has per-site statuses.
  • Has an “Add a site…” menu for sites the element can be added to. Newly-added sites get a status toggle if the element will be autosaved to them. They also get a button for undoing the selection: for element types that don’t autosave drafts it’s shown right away; otherwise it’s shown once the draft has been autosaved to the site (if the user is allowed to delete the draft for the site), and deletes the draft for that site via elements/delete-for-site. elements/save-draft responses now include a canDeleteForSite key for this.

Unlike the Status pane, all of this is visible without clicking the “…” button first.

Element type support

  • craft\base\Element::showSitesField() determines whether the Sites pane should be used in place of the Status pane. By default it’s used for localized elements that support multiple sites, regardless of whether the element type has statuses. Element types that have statuses and override statusFieldHtml() keep the Status pane, so any customizations aren’t lost, and element types can override showSitesField() to opt out.
  • Element types without statuses only show the Sites pane when there are sites the element can be added to, or when craft\base\Element::hasCustomPropagation() returns true.
  • If sitesFieldHtml() doesn’t return anything (e.g. on single-site installs), the Status pane is shown instead, for element types with statuses.
  • The Status pane’s behavior is unchanged.

Also fixes Elements::deleteElementsForSite() not finding provisional drafts in other sites, which caused them to be deleted entirely (e.g. when deleting an element for a site while editing a provisional draft), and lines up sidebar pane headings (“Sites”, “Status”, “Notes about your changes”, etc.) with the labels within the panes.

Related discussions

Collapsed:

Sites pane, with “Europa Museum” selected and enabled, and a “2 more sites” button

Expanded:

Sites pane, with “Europa Museum” selected and enabled, and “2 more sites” button expanded, revealing two additional sites below as links, both also enabled.

With “Add a site…” button:

Sites pane, with “Europa Museum” selected and enabled, and an “Add a site…” button below it.

brandonkelly and others added 2 commits October 22, 2026 05:33
Multi-site entries now get a Sites pane in place of the Status pane, which
lists the sites the entry is saved to (current site first, with 2+ other sites
within a disclosure), with status toggles and links to the entry in each site,
and lets authors add the entry to other sites.

Element types without statuses get the Sites pane when there are sites the
element can be added to, or when Element::hasCustomPropagation() returns true.
Element types that don't autosave drafts get a button for removing
newly-added sites before saving.

The Status pane is still available for other element types, via
Element::showSitesField().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brandonkelly and others added 6 commits October 22, 2026 05:43
Site names in the Status pane are no longer linked, newly-added sites no longer
get an undo button, and the current site no longer gets a checkmark. Those are
now exclusive to the Sites pane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ching sites in slideouts

- Element::showSitesField() now returns true for localized elements that support
  multiple sites, unless the element type has statuses and overrides
  statusFieldHtml().
- The Sites pane only lists sites the user can edit.
- Clicking on another site within a slideout's Sites pane switches the slideout
  to that site, via ElementEditorSlideout::switchSite().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- elements/save-draft responses now include canDeleteForSite.
- Once an element's draft has been autosaved to a site that was added via the
  Sites pane, that site gets a button for deleting the draft for the site again,
  if the user is allowed to.
- Fixed Elements::deleteElementsForSite() not finding provisional drafts in
  other sites, which caused them to be deleted entirely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

CMS-2562

…pane

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brandonkelly
brandonkelly merged commit 9a82679 into 5.12 Oct 22, 2026
11 checks passed
@brandonkelly
brandonkelly deleted the feature/sites-pane branch October 22, 2026 09:34
brandonkelly added a commit that referenced this pull request Oct 22, 2026
Ports the Sites pane (#20061) and volume propagation methods (#20060) to 6.x:

- Volumes have a propagationMethod setting (all/custom), with a migration
- Assets in custom-propagation volumes choose which sites they're saved to,
  and can be deleted for individual sites
- Element sidebars show a Sites pane in place of the Status pane, in both the
  legacy editor and the Inertia editor (new ElementSites UI control)
- Element editor slideouts can switch sites
- Deleting an element for its only site soft-deletes it
- Asset lookups and uploads respect the site they exist in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MoritzLost MoritzLost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up from #13982 … 

I like it, it's an improvement over the ellipsis icon. But it's still way too subtle in my opinion, and the disclosure menu is sort of unnecessary for projects that only have a couple of sites. There should be a limit below which the list is just shown in full, without having the authors always have to click on the disclosure icon to quickly check the propagation status or toggle the current entry on or off in multiple sites.

There's an argument to be had about the appropriate limit for the disclosure toggle. IMO it should be somewhere between 6 and 10. But it should be at least 5 – no use showing a disclosure toggle that takes up nearly as much space as the full content would.

Comment thread src/base/Element.php Resolved
@brandonkelly

Copy link
Copy Markdown
Member Author

@MoritzLost Thanks for the feedback! Done: bee5d3d

@MoritzLost

Copy link
Copy Markdown
Contributor

@brandonkelly That's great, thanks!! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants