Patterns: Allow the override id to be changed#58531
Closed
glendaviesnz wants to merge 1 commit intotrunkfrom
Closed
Patterns: Allow the override id to be changed#58531glendaviesnz wants to merge 1 commit intotrunkfrom
glendaviesnz wants to merge 1 commit intotrunkfrom
Conversation
49 tasks
|
Size Change: +81 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Member
|
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. |
Contributor
Author
|
I have doubts about the reliability of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
nameproperty, 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 overridesOverride settingsand check that a random id is assignedrecipe-titleand 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