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

Copying a pattern from /patterns means losing details in header #53764

Closed
warudin opened this issue Aug 17, 2023 · 1 comment
Closed

Copying a pattern from /patterns means losing details in header #53764

warudin opened this issue Aug 17, 2023 · 1 comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended

Comments

@warudin
Copy link

warudin commented Aug 17, 2023

Description

Registering a pattern by adding a .php file to the /patterns folder has some advantages in regard to functionality. Mainly, you can configure in which context a pattern can be used, by adding something like Block Types: core/query in the patterns header.

Having a pattern registered via the /patterns folder results in a locked pattern which can't be modified directly. If a user wants to modify the pattern in the Full Site Editor, this can only be done by duplicating the pattern to the "My patterns" category. After doing this, the copied pattern will not have the configuration from the original file.

Only the Title value from the original header can be controlled through the Full Site Editor. Other aspects can not be changed and are lost.

I think the Block Types value can be important for the user experience. The original configuration shouldn't be lost in my opinion, but since there are no controls for all rules in the header I'm not sure what can be done.

Step-by-step reproduction instructions

  1. Register a pattern by adding a .php file in the /patterns folder, add something like Block Types: core/query in the file header. This will result the pattern only being available in the inserter when adding a core/query block
  2. Go to Appearance > Editor > Patterns and find your pattern
  3. Press the three horizontal dots in the bottom right of the pattern and press Copy to My patterns

Observations:

  • The new pattern won't be available in the context of the Block Types block
  • The pattern will be available from the Inserter directly

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.3
  • Gutenberg 16.5 RC1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Aug 18, 2023
@annezazu
Copy link
Contributor

Hey there! Thanks for opening this. I'm going to consolidate it with this one: #53396 as it covers the same use case. I agree, this something key to have add to better wed all of the various options now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants