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

Extend the Block.json specification to be able to restrict blocks to particular templates #30679

Open
priethor opened this issue Apr 9, 2021 · 1 comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.

Comments

@priethor
Copy link
Contributor

priethor commented Apr 9, 2021

What problem does this address?

With the addition of theme blocks such as Archive Title block, Term Description, or Post Categories among others, the inserter offers, both in the post and template editors, a number of blocks that don't work as intended unless they are inserted in specific templates. For instance, an Archive Title block should only be available when editing an archive template.

What is your proposed solution?

Extending the block.json API to either:

  • Be able to restrict blocks to specific templates.
  • Be able to disable a block by default unless a template specifically enables it.
@priethor priethor changed the title Extend the Block specification to specify in which the templates blocks can be added to Extend the Block.json specification to specify in which the templates blocks can be added to Apr 9, 2021
@priethor priethor added [Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement. labels Apr 9, 2021
@priethor priethor changed the title Extend the Block.json specification to specify in which the templates blocks can be added to Extend the Block.json specification to be able to restrict blocks to particular templates Apr 9, 2021
@gziolo
Copy link
Member

gziolo commented Apr 14, 2021

This is very related to the previous comment #13693 (comment).

Extend flexibility of parent propert

We should create a follow-on issue for this. That said, it's not directly mentioned as being possible in this RFC. Which begs the question: Should it be, if we're saying it ought to be possible?

It's also being tracked in #16209 which contains several proposals to enhance the block metadata stored in block.json files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants