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

Allow Users To Save Patterns via Editor UI #85

Closed
that-mike-bal opened this issue Jul 14, 2022 · 4 comments
Closed

Allow Users To Save Patterns via Editor UI #85

that-mike-bal opened this issue Jul 14, 2022 · 4 comments

Comments

@that-mike-bal
Copy link

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.

@pbking
Copy link
Contributor

pbking commented 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
Copy link
Member

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
Copy link
Contributor

t-hamano commented 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
Copy link
Member

mikachan commented 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.

@mikachan mikachan closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants