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

Sort order for categories. #643

Closed
BE-Webdesign opened this issue May 3, 2017 · 4 comments
Closed

Sort order for categories. #643

BE-Webdesign opened this issue May 3, 2017 · 4 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 [Type] Question Questions about the design or development of the editor.

Comments

@BE-Webdesign
Copy link
Contributor

This is tied in with the inserter menu. What do we want the default sort order to be for the categories and blocks in those categories? This mainly becomes a concern when other plugins will be able to register blocks and categories.

@BE-Webdesign BE-Webdesign added the [Type] Question Questions about the design or development of the editor. label May 3, 2017
@BE-Webdesign
Copy link
Contributor Author

BE-Webdesign commented May 3, 2017

Also important to this topic is whether we want categories to be a one to one relationship or a one to many relationship for blocks.

@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 May 4, 2017
@aduth
Copy link
Member

aduth commented May 4, 2017

one to one relationship or a one to many relationship for blocks.

What's the use case for one-to-one ?

@BE-Webdesign
Copy link
Contributor Author

BE-Webdesign commented May 4, 2017

one to one is what we have right now for blockType => category and it is one to many for category => blockType, which on the whole is a one to many relation. (I think of relationships weirdly and do not have a CS degree, so I could be using the wrong terminology.) If we keep a blockType to only belonging to one category it will keep the ordering simple and displaying the blockTypes simple in the inserter, or wherever else we need to display blockTypes. But there could be a reason to assign multiple categories as an array i.e. Common and Media for image, video etc. If we go one to many we would want to do something like:

registerBlock( {
  namespace: core,
  name: embed,
  categories: [ 'common', 'media' ]
} );

If we want blocks to belong to many categories it will make displaying them a lot more complex. Maybe there is a user experience benefit that outweighs keeping things simple. So in total the relation would become a many to many, which are usually ugly to deal with unless the benefits of it are superior. I personally don't find an urgent need to have multiple categories for each blockType, but this would probably be a good decision for @jasmussen to chime in on.

@mtias
Copy link
Member

mtias commented Aug 31, 2017

We don't want a block to belong to multiple categories, at least for now. There's a PR to allow creating new categories. It's likely we could assign a plugin-block that hasn't specified a category to be under a "Plugins" category. Same for themes.

@mtias mtias closed this as completed Aug 31, 2017
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 [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

3 participants