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

Open
mtias opened this issue Aug 1, 2019 · 2 comments

Comments

@mtias
Copy link
Contributor

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?

@shaunandrews

This comment has been minimized.

Copy link

commented Aug 7, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Aug 8, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.