Gutenberg: Create system for names and descriptions of FSE templates

Created on 1 Oct 2020  路  4Comments  路  Source: WordPress/gutenberg

We should create a system which lets users easily understand and identify the different templates available in WordPress. For example, singular by itself is not informative unless you already know about the template hierarchy.

Though I'm not sure yet where this will appear in the FSE interface (or what the copy should be for describing things), we can at least create something like getTemplateInfo, which takes a template slug/identifier and returns helpful information about it.

cc @jameskoster

[Feature] Full Site Editing [Type] Enhancement

Most helpful comment

Just a note from me: These should be filterable. This way plugins like woocommerce and others can add their own templates & descriptions for their template-parts.

All 4 comments

I made a rough outline of some descriptions we might use in this Figma. These definitely need refinement, but could serve as a starting point?

Also worth noting, if we are able to determine which templates are actively in use at a site (as mentioned here), we may be able to dynamically generate more contextual template descriptions. Appreciate this may not be a 'v1' thing though :)

Also worth noting that user defined templates should also _allow_ a description, which could be configured through the excerpt field in the wp_template entry.

Note: this was partially accomplished in #25739, which added a basic map of template slugs to template info.

Just a note from me: These should be filterable. This way plugins like woocommerce and others can add their own templates & descriptions for their template-parts.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spocke picture spocke  路  3Comments

nylen picture nylen  路  3Comments

franz-josef-kaiser picture franz-josef-kaiser  路  3Comments

youknowriad picture youknowriad  路  3Comments

cr101 picture cr101  路  3Comments