-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add semantic patterns documentation #38778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added a small change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! It needs to be better advertised . There is also something with attributes where you can mark their role as content
in case you want to inject that into the pattern. @ntsekouras might know better if that applies here.
Good call @gziolo Yeah, the role is indeed related. It's still experimental though, so let's wait a bit before adding that information. |
'categories' => array( 'header' ), | ||
// Assigning the pattern the "header" area. | ||
'blockTypes' => array( 'core/template-part/header' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth noting that core/template-part/header
is something that is used only by template parts
and is not a generic API for block variations. It had been discussed to support block variations with the same format, but eventually left for template parts to override the filtering patterns function with that naming convention.
I created a follow up for this one here: #38809, if you think it brings some value 😄 |
related #28737
While I try to work on #28737 I noticed that we actually already support these kind of semantic patterns but that it was not documented properly.
It was not easy to come with the right wording here. So please happy to take on suggestions.