Skip to content

Grouping custom templates in the templates list  #48651

@jameskoster

Description

@jameskoster

Custom templates are somewhat unique as they can be applied manually to multiple post types, rather than automatically according to the template hierarchy. This makes them worthy of some separation in the templates list:

Templates
Original issueThere have been a few issues (https://github.com//issues/44302, https://github.com//issues/42325, https://github.com//issues/48589) where the idea of grouping templates has come up. Doing so would enable a couple of practical use cases in the near term:
  1. Improve the presentation in the list in the Site Editor's Templates panel (e.g. Improve organization of templates to reflect importance/hierarchy #44302 (comment)).
  2. Delineate the purpose of some confusing templates like Home
  3. Allow us to simplify the Add Template menu which gets very long as you add more plugins

My initial thought would be to use post types as a primary grouping method, with some ad hoc groups for certain core templates. Example:

Pages Blog / Posts General Custom
Front Page
Page
Attachment †
Privacy Policy
Home
Single Post
Category
Tag
Date
Author
Taxonomy
Archive
Singular
Search
404
Custom
Any custom templates

† I believe attachments are technically posts, but Pages feel like a better fit, in my mind at least.

I think this method can scale quite nicely to accommodate custom post types. It also opens the door to much simpler feature toggling in the future. For example adding a Blog to a site that doesn't already have one could be a single action that adds Home, Single, Category, Tag, Date, Author all at once. By extension it could even be a gateway to a UI for creating custom post types / taxonomies.

Before we can enable any such refinements/actions in the UI, I presume we'll need to install an API, and of course decide on how to group templates. That's what this issue is for. The above is only an initial suggestion to kick off discussion.

Metadata

Metadata

Assignees

Labels

Needs Accessibility FeedbackNeed input from accessibilityNeeds DevReady for, and needs developer efforts[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Status] In ProgressTracking issues with work in progress[Type] DiscussionFor issues that are high-level and not yet ready to implement.

Type

No type
No fields configured for issues without a type.

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions