You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a related/similar idea in this issue but we didn't pursue it since it creates some confusion or the average user with reusable blocks.
Since this plugin is meant to be used by theme creators, it would make sense to give them the ability to save their patterns while they are creating them instead of having to go in and register them as a totally separate step.
I think this can be as easy as adding this option to the Group block but I don't have strong feelings about the experience as long as it's available in the actual editor.
I tinkered with this concept a little bit today. It's not as straightforward as I was hoping.
Within the site editor the markup of a pattern being used kind of goes away. If you insert a pattern into a template, or if you have already referenced from a template, it renders in the site editor as the blocks that were in the pattern not a reference to the pattern. (i.e. <!-- wp:pattern {"slug":"blockbase/comments"} /--> ).
Therefore making changes to the template containing that pattern and then exporting that template will not contain a reference to the pattern. This is already a drawback of using Create Block Theme to manipulate themes leveraging patterns.
Because of this there's no step during export at which we could turn things into patterns and no mechanism within the FSE that would make a pattern actually be used in a template.
We need better pattern management within WordPress but I think that might be outside the scope of what this plugin can do.
Now that we have pattern creation within Gutenberg, is this something we can revisit? Would be great if the existing generate options included the patterns created by the theme author.
For example, "Export $theme_name" would also export patterns I created within the editor.
Reacted by Héctor, Sarah Norris, Jason Crist, Hannes Leismann and Brian Coords
I think it would be nice if the saved patterns were exported along with the theme export, which isn't currently supported. But maybe this is covered in #287, so we could still close this issue.
Activity
pbking commentedon Aug 18, 2022
I tinkered with this concept a little bit today. It's not as straightforward as I was hoping.
Within the site editor the markup of a pattern being used kind of goes away. If you insert a pattern into a template, or if you have already referenced from a template, it renders in the site editor as the blocks that were in the pattern not a reference to the pattern. (i.e.
<!-- wp:pattern {"slug":"blockbase/comments"} /-->).Therefore making changes to the template containing that pattern and then exporting that template will not contain a reference to the pattern. This is already a drawback of using Create Block Theme to manipulate themes leveraging patterns.
Because of this there's no step during export at which we could turn things into patterns and no mechanism within the FSE that would make a pattern actually be used in a template.
We need better pattern management within WordPress but I think that might be outside the scope of what this plugin can do.
richtabor commentedon Jul 10, 2023
Now that we have pattern creation within Gutenberg, is this something we can revisit? Would be great if the existing generate options included the patterns created by the theme author.
For example, "Export $theme_name" would also export patterns I created within the editor.
t-hamano commentedon Jan 7, 2024
With WordPress 6.4, it is now possible to import/export patterns on the Site Editor.
Is this feature sufficient to solve this issue?
mikachan commentedon Jan 8, 2024
I think it would be nice if the saved patterns were exported along with the theme export, which isn't currently supported. But maybe this is covered in #287, so we could still close this issue.