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

Cannot add pattern within a block #31342

Closed
bradhogan opened this issue Apr 29, 2021 · 7 comments
Closed

Cannot add pattern within a block #31342

bradhogan opened this issue Apr 29, 2021 · 7 comments
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] Needs More Info Follow-up required in order to be actionable.

Comments

@bradhogan
Copy link

If the user has a cover block, for example, and they want to add a pattern within that cover block, it is not an option.

I can understand if all blocks shouldn't allow patterns (the button block, for instance), but the cover block should at least be one exception as it would be useful to add column patterns within it.

Screen Shot 2021-04-29 at 9 32 54 AM

@ntsekouras
Copy link
Contributor

Hey 👋 - many blocks that have inner blocks (like Cover) can insert a pattern inside. In the gif below you can see that this is possible. One thing worths noting though is that there is a (not in depth) check that checks if pattern's blocks are allowed based on where they are going to be inserted. For example if we have in our settings/preferences some blocks that are not allowed, the patterns that include those blocks are not shown as an option. Could be that the case of the issue you're having?

cover

@ntsekouras ntsekouras added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] Needs More Info Follow-up required in order to be actionable. labels Apr 30, 2021
@bradhogan
Copy link
Author

bradhogan commented Apr 30, 2021 via email

@ntsekouras
Copy link
Contributor

Is there a setting that needs to be added to registered patterns to
allow them to appear as an option within blocks?

No. The default is to show the allowed patterns where possible - there is a (not in depth) check that checks if pattern's blocks are allowed based on where they are going to be inserted.

If patterns are shown in top level and are not removed by this filter for example, there should be patterns available inside other blocks as well.

Of course this depends on a couple more things about what pattern is being allowed. For example in a Buttons block you can insert only Button block, so a pattern with anything else will not be shown. Also you should check the allowed blocks you have in Block manager that could affect what patterns are shown.

@bradhogan
Copy link
Author

I guess back to the original issue though.. I do not see the pattern tab when using the Cover block, for example (see below). This happens with just the default theme and no plugins as well.

bb807257-adda-4c43-8b6f-639d41075de4

@ntsekouras
Copy link
Contributor

ntsekouras commented May 4, 2021

and no plugins as well.

The functionality for showing patterns inside a block was added here: #28459. (GB plugin v. 10.0)

Maybe you have an older WP version that doesn't contain this code?

@bradhogan
Copy link
Author

I'm using the most recent version of WordPress (5.7.1) with no plugins active and the default Twenty TwentyOne theme (see below). Other ideas?

7d54253b-aa7e-45c6-aa56-23ceeed57be9

@ntsekouras
Copy link
Contributor

ntsekouras commented May 4, 2021

Yeah, as noted above this functionality was implemented in GB version 10.0.
WordPress 5.7.1 has GB versions 9.3-9.9.

Reference: https://developer.wordpress.org/block-editor/contributors/versions-in-wordpress/

I'm closing this issue as it will be resolved with the new WP version (5.8)

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 [Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

No branches or pull requests

2 participants