Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patterns data view: Map more pattern data to fields #63566

Open
jameskoster opened this issue Jul 15, 2024 · 0 comments
Open

Patterns data view: Map more pattern data to fields #63566

jameskoster opened this issue Jul 15, 2024 · 0 comments
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

Screenshot 2024-07-15 at 14 29 57

There are various data points associated with registered patterns:

  • title (required): A human-readable title for the pattern.
  • content (required): Block HTML Markup for the pattern.
  • description (optional): A visually hidden text used to describe the pattern in the inserter. A description is optional but it is strongly encouraged when the title does not fully describe what the pattern does. The description will help users discover the pattern while searching.
  • categories (optional): An array of registered pattern categories used to group block patterns. Block patterns can be shown on multiple categories. A category must be registered separately in order to be used here.
  • keywords (optional): An array of aliases or keywords that help users discover the pattern while searching.
  • viewportWidth (optional): An integer specifying the intended width of the pattern to allow for a scaled preview of the pattern in the inserter.
  • blockTypes (optional): An array of block types that the pattern is intended to be used with. Each value needs to be the declared block’s name.
  • postTypes (optional): An array of post types that the pattern is restricted to be used with. The pattern will only be available when editing one of the post types passed on the array. For all the other post types, the pattern is not available at all.
  • templateTypes (optional): An array of template types where the pattern makes sense, for example, 404 if the pattern is for a 404 page, single-post if the pattern is for showing a single post.
  • inserter (optional): By default, all patterns will appear in the inserter. To hide a pattern so that it can only be inserted programmatically, set the inserter to false.
  • source (optional): A string that denotes the source of the pattern. For a plugin registering a pattern, pass the string plugin. For a theme, pass the string theme.

Description, Categories, and Keywords in particular feel like potential candidates for mapping to fields in the Patterns data view. This would enable users to sort and filter with more granularity. Description could be combined (#58012) with Title in the table layout.

Additionally the search function should probably reference keywords.

Design is required to define the display config for Grid layout, plus sorting/filtering capabilities.

@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond Needs Design Needs design efforts. labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.
Projects
Status: No status
Development

No branches or pull requests

1 participant