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

Update curating the editor to include starter patterns for templates #53398

Merged
merged 3 commits into from Aug 7, 2023

Conversation

annezazu
Copy link
Contributor

@annezazu annezazu commented Aug 7, 2023

What?

This updates the curating the editor doc to include the 6.3 update around starter patterns for templates ahead of the 6.3 release.

Why?

To keep the docs up to date :)

Copy link
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

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

Thanks for always making sure this guide is up to date :)


In the same way patterns can be prioritized for new posts or pages, the same experience can be added to the template creation process. When patterns declare support for the 'templateTypes' property, the patterns will appear anytime a template that matches the designation are created along with the options to start from a blank state or use the current fallback of the template. By default, WordPress does not include any of these patterns.

To opt into this, a pattern needs to specify a property called `templateTypes`, which is an array containing the templates where the patterns can be used as the full content. [Here's an example](https://gist.github.com/annezazu/99ce2f84fa033dae48eacc50a8287bae) of a pattern that would appear when creating a 404 template.
Copy link
Member

Choose a reason for hiding this comment

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

I still always find it confusing whether to reference the properties in the form for manually registering patterns via the register_block_pattern function or the way it should be added to the comment header in file inside the patterns/ directory of a theme... Template Types or templateTypes =D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great call out. I think that should be addressed elsewhere though, like the Theme Handbook, and we can link off. Going to leave for now but keep it in mind :)

@annezazu annezazu merged commit c0c0847 into trunk Aug 7, 2023
50 checks passed
@annezazu annezazu deleted the annezazu-starter-pattern-template branch August 7, 2023 19:25
@github-actions github-actions bot added this to the Gutenberg 16.5 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants