WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.54k stars 4.21k forks source link

Try block hooks on header template parts #66103

Open richtabor opened 1 month ago

richtabor commented 1 month ago

It would interesting if you could leverage block hooks within the header template part to toggle on/off:

This way you could configure a header's contents without having to add blocks.

Visual

Image

carolinan commented 1 month ago

In what way is this useful outside of the context of WordPress.com?

It is a genuine question, not an argument. There needs to be an API for onboarding that any developer can use. I think this needs to be thought through more carefully.

carolinan commented 1 month ago

For example, developers still can not add their own menu items and pages to the Site Editor, "navigation" sidebar correct? where they would be able to add their interface for "configuring the header content without having to add blocks"

richtabor commented 1 month ago

In what way is this useful outside of the context of WordPress.com?

It would be helpful if I could select a header template part and toggle on/off common blocks in the header. This is not an onboarding issue, but rather a way to enable common blocks in common areas.

Perhaps the hook would be active if the block is present, so you can turn off/on any of them.


EDIT: This has nothing to do with WordPress.com :)

Here's what you see when you select a header template part, and when you click to edit:

Image

Image

We already have these blocks in the "Content" panel—it just doesn't do anything (the first is entirely unhelpful).

It would be super helpful if you could turn off blocks from here, or add other blocks that have been defined within the template part already. Instead of having to search, find, open list view, drag it around, etc.

mtias commented 1 month ago

Duplicate of #65676?

I think this is a crucial piece of the block themes puzzle, allowing plugins to extend themes and surfacing those extensions in the most intuitive way for users.

richtabor commented 2 weeks ago

Duplicate of https://github.com/WordPress/gutenberg/issues/65676?

Perhaps a child. I like that this is specific to the header template part.