-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Allow the override id to be changed #58531
Conversation
Size Change: +81 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
That seems like one of the viable approaches. The challenge with the @kevin940726 suggested in #53705 (comment) that we support both Overall, I'm positive that we can find a solution to the problem. |
I have doubts about the reliability of the |
What?
Makes the new pattern override id editable.
Why?
There has been some discussion about how pattern overrides can be set up in order to allow content to be easily switched between similar patterns, and how the current random ids do not allow for this.
There have been suggestions of reusing the existing block meta
name
property, but this adds a mental overhead to uses to know that these have to be unique across all blocks in the pattern, and also these names appear in, and are editable from, the list view, so a risk of users renaming for visual reasons without an understanding of the impact of the pattern override data.How?
This PR aims to solve this problem by setting the default id as random so your average user does not have to worry about it, and there is no potential conflict/impact with changes to block name.
For theme authors, etc. that wish to set up patterns that can shuffle content, etc. in future iterations of this feature the id value can be overridden either in the editor UX or the pattern code with a more meaningful unique string, eg.
recipe-title
.Testing Instructions
Allow instance overrides
Override settings
and check that a random id is assignedrecipe-title
and check that this id is set in the pattern attributes content and that the pattern overrides work as expected in a postScreenshots or screencast
override-id.mp4