Skip to content

Allow Users To Save Patterns via Editor UI  #85

Closed

Description

@that-mike-bal

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.

Activity

  1. pbking commented on Aug 18, 2022

    @pbking
    Contributor

    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.

  2. richtabor commented on Jul 10, 2023

    @richtabor
    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.

  3. t-hamano commented on Jan 7, 2024

    @t-hamano
    Contributor

    With WordPress 6.4, it is now possible to import/export patterns on the Site Editor.

    Is this feature sufficient to solve this issue?

  4. mikachan commented on Jan 8, 2024

    @mikachan
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions