Skip to content

Semantic Template Parts #27337

@mtias

Description

@mtias

Once a subset of template parts start to be defined (#26599), it'll open up the doors for some work we have hinted at before.

  • Template-Specific Patterns. Once we identify a template part as being a header area, we can offer a subset of available patterns of a category header. The creation flow of a template part that is marked as a header can be optimized for that specific flow, allowing users to choose from different global headers. Themes could also supply a few variations of their header, ensuring they only show up for the header template part and not as regular patterns.
  • Block Filtering. Since we know a header area is likely to include a site title, site tagline, logo, navigation, etc, we can surface those blocks in quick inserters by default.
  • HTML Semantics and Accessibility. We could suggest or enforce certain HTML like <header>. We could also warn if a header doesn't contain a site title, or if the site title is not set to using h1. Knowing template regions is also highly valuable for naturally including elements like FSE: Add skip link #21507 (root or header).
  • Theme Switching. Knowing that a template part is a header is a very valuable asset on theme switching, since we can do a lot more in trying to map certain content from one theme to another, or allowing a user to swap the header from a theme with another one.

Any other ideas where we can leverage the added knowledge of semantic template parts in the editor?

Metadata

Metadata

Labels

Needs DesignNeeds design efforts.[Type] DiscussionFor issues that are high-level and not yet ready to implement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions