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 Collection instead of category #16866

Closed
mtias opened this issue Aug 1, 2019 · 3 comments
Closed

Block Collection instead of category #16866

mtias opened this issue Aug 1, 2019 · 3 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Inserter The main way to insert blocks using the + button in the editing interface

Comments

@mtias
Copy link
Member

mtias commented Aug 1, 2019

So far we have allowed people to register a new category with an icon and it's been used by many block libraries or collections to register all the blocks in a single category.

This is not the most optimal for users because blocks that really belong in core categories are placed instead in plugin specific ones. However, it's also useful to see all the blocks coming from a single source. Several libraries have requested we allow more than one category for a block, but I think that is a sub-par solution and has the potential of making categories useless.

So I'd like to propose an addition to the block API which would be the notion of a collection. The way it'd work would be something like the following:

registerBlockCollection( namespace, title, icon = {} );
  • namespace would be matched against a block prefix and included automatically in a registered collection.
  • a block can then register itself in the most appropriate functional category.
  • if a collection is not registered nothing happens.

Thoughts?

@mtias mtias added [Feature] Block API API that allows to express the block paradigm. [Feature] Inserter The main way to insert blocks using the + button in the editing interface labels Aug 1, 2019
@shaunandrews
Copy link
Contributor

Would we expose the collection anywhere in the UI? Like you said it could be helpful to see all blocks in a collection, but we’d need to offer someway to sort blocks by collection along with the current category listing.

@mtias
Copy link
Member Author

mtias commented Aug 8, 2019

By default, a registered collection would work as a block category does today. (At least as v1.)

@mapk
Copy link
Contributor

mapk commented Feb 4, 2020

Since this has essentially been merged with #17609, I'm closing this issue.

@mapk mapk closed this as completed Feb 4, 2020
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. [Feature] Inserter The main way to insert blocks using the + button in the editing interface
Projects
None yet
Development

No branches or pull requests

3 participants