Skip to content

Site Editor: Consider compatibility regarding non-block themes and the Library menu #52150

@t-hamano

Description

@t-hamano

What problem does this address?

For non-blocking themes, Template Parts Editor can be enabled with the following code:

add_theme_support( 'block-template-parts' );

I believe that the addition of the Library (aka Patterns) menu to the Site Editor has caused this opt-in support to behave differently than originally expected, resulting in the following problems.

  • When the Appearance > Template Parts menu is accessed, a list of all template parts is displayed, but the upper Library menu can be accessed. This means that new template part will be allowed to be added. As I mentioned in this comment, this should not be the expected behavior in a non-block theme.
  • I'm expecting to opt in to the template parts editor only, but it also provides pattern (synced/non-synced) management functionality. While this may be gratifying, I don't think it is the expected behavior of this theme support.

What is your proposed solution?

In order to maintain the functionality originally intended by this theme support, I suggest not allowing access to the Library menu. This means that when you press the Back button in the All Template Part menu, you will return to the Admin page, not the Library.

However, in this case, the non-block theme will not be able to take advantage of the convenient pattern management features and new features that may be implemented in the Libary menu in the future.

Alternatively, new opt-in support for accessing the Library menu could be introduced.

add_theme_support( 'library' );
// or
add_theme_support( 'patterns' );

If you have any good suggestions, please comment.

975467f9cbed70f1ec92c3069bdd2e07.mp4

Metadata

Metadata

Assignees

Labels

[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Focus] Blocks AdoptionFor issues that directly impact the ability to adopt features of Gutenberg.[Type] DiscussionFor issues that are high-level and not yet ready to implement.[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions