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

Block patterns with "Inserter: no" are listed in the Site Editor > Patterns list #52629

Closed
carolinan opened this issue Jul 14, 2023 · 5 comments · Fixed by #52675
Closed

Block patterns with "Inserter: no" are listed in the Site Editor > Patterns list #52629

carolinan opened this issue Jul 14, 2023 · 5 comments · Fixed by #52675
Assignees
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

carolinan commented Jul 14, 2023

Description

Theme patterns with Inserter: no in the pattern file header shows up under Appearance > Editor > Patterns,
but they do not show up in Block Editor > Block Inserter > Patterns tab.

I think this should be consistent. It could be confusing for some users that there are patterns listed that can not be inserted.

Step-by-step reproduction instructions

In Twenty Twenty-Three, add Inserter: no to the file header of the post meta block pattern: twentytwentythree/patterns/post-meta.php.

<?php
/**
 * Title: Post Meta
 * Slug: twentytwentythree/post-meta
 * Categories: query
 * Keywords: post meta
 * Block Types: core/template-part/post-meta
 * Inserter: no
 */
?>

Save the file changes. 😄
Go to Appearance > Editor > Patterns and see that the post meta pattern is listed under Theme Patterns > Posts

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

@carolinan carolinan added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Decision Needs a decision to be actionable or relevant labels Jul 14, 2023
@justintadlock
Copy link
Contributor

The sidebar label text for these also says that the patterns can be inserted:

For insertion into documents where they can then be customized.

@widoz
Copy link
Contributor

widoz commented Jul 16, 2023

Have we considered the fact that, at the end you can copy / paste the blocks or convert the blocks rendered in a template into pattern again making them available everywhere?

As a content creator it is just a little bit annoying to recreate the pattern but nonetheless an Insert: no will not prevent me to do it (the annoying part is to discover where the pattern is being used).

Based on that logic does still make sense to have "hidden" patterns? I am missing surely something ... but what's the benefit of not making available a pattern if then I can still re-create it?

@carolinan
Copy link
Contributor Author

I am sure different theme authors will give you different answers.
Hidden patterns are not used to prevent advanced users from using patterns, rather hidden to not confuse other users.
A pattern used to translate texts in the context of post meta information is not useful to most users, but theme developers can use them to not have to repeat code in templates.

@carolinan
Copy link
Contributor Author

the annoying part is to discover where the pattern is being used.

As a user you should not need to even think about this. These patterns are building parts of theme templates,
they are not synced patterns that can be edited. When viewed they should just look like any blocks in a template, as a user, you wouldn't even need to know that the theme developer used a pattern to place those blocks there.

@carolinan carolinan removed the Needs Decision Needs a decision to be actionable or relevant label Jul 17, 2023
@carolinan carolinan self-assigned this Jul 17, 2023
@ndiego ndiego added the [Type] Bug An existing feature does not function as intended label Jul 17, 2023
@ndiego
Copy link
Member

ndiego commented Jul 17, 2023

I have labeled this as a bug. These patterns should not be insertable or viewable from within the Editor or Site Editor UI. Using Inserter: no is the only way to create a pattern designed specifically for internal theme use.

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 [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants