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

Create way to manage shared blocks in bulk #7387

Closed
noisysocks opened this issue Jun 20, 2018 · 10 comments
Closed

Create way to manage shared blocks in bulk #7387

noisysocks opened this issue Jun 20, 2018 · 10 comments
Assignees
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Enhancement A suggestion for improvement.

Comments

@noisysocks
Copy link
Member

It would be nice if there were a way of bulk managing shared blocks within the WP Admin. The main use case is for deletion: currently, one has to insert a shared block before it can be deleted. This makes deleting several shared blocks very cumbersome.

Some requirements:

  • Ability to paginate through more than 100 shared blocks
  • Ability to easily delete multiple shared blocks
  • (Optional) Ability to easily rename a shared block
  • (Optional) Ability to edit the contents of a shared block

Since shared blocks are implemented using a CPT, it might be possible to fulfil these requirements by simply linking users to wp-admin/edit.php?post_type=wp_block.

cc. @mtias

@noisysocks noisysocks added [Type] Enhancement A suggestion for improvement. [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) labels Jun 20, 2018
@noisysocks noisysocks self-assigned this Jun 20, 2018
@mtias
Copy link
Member

mtias commented Jun 20, 2018

Yes, I like starting simple just with what wp-admin offers for bulk deleting before building custom UI in the block library. Could be just a "cog" icon in the shared blocks panel that links to that view. Not sure if we should disable edit for content, only allowing title edits and deleting.

@slimmilkduds
Copy link

For me the shared blocks is one of the features who has most potential with Gutenberg. Being able to bulk edit them seems like a no brainer. In my world the best thing would be to let them be treated as any CPT, so you could assign taxonomies to them, set custom post statuses etc. For the project I'm working on we are already (at a very early stage) starting to run in to the problem of having too many shared blocks and no good way of dealing with them.

@noisysocks
Copy link
Member Author

Been experimenting with a few things here. Some notes:

  • Displaying wp_block posts in WP Admin is easy enough by changing how we register the CPT
  • Removing the Edit and Add New buttons is very hacky but do-able
  • WIP: Blocks: Reimplement shared block as embedded editor #7453 ties in very nicely with this as it treats shared blocks more like regular CPTs. This means we can edit a shared block in WP Admin using Gutenberg like any old post
    • This lets users edit a shared block and leave it as a draft, which is cool. We have to be careful about handling this though because draft shared blocks is not something we support in the editor

I'm thinking the best path forward is to, for now, expose shared blocks in WP Admin and hackily hide the Edit and Add New buttons. If/when #7453 goes ahead we can revisit this and possibly allow shared blocks to be edited like a regular post.

@mtias
Copy link
Member

mtias commented Jul 3, 2018

Sounds like a good initial path for me. Also, others can build on top of it if they want.

@mtias mtias added Needs Design Feedback Needs general design feedback. Needs Design Needs design efforts. and removed Needs Design Feedback Needs general design feedback. labels Jul 3, 2018
@mtias
Copy link
Member

mtias commented Jul 3, 2018

Adding needs design here since we'd need to link to the page to manage the post type from the inserter. I imagine a cog button on the shared blocks panel or similar.

@karmatosed
Copy link
Member

A suggestion for the design would be this:

artboard

I put it at the far bottom corner because having in the actual title bar felt like an accidental click was possible.

@mtias
Copy link
Member

mtias commented Jul 19, 2018

This looks good to me.

@mtias
Copy link
Member

mtias commented Jul 19, 2018

One thing, given it's at the bottom, it could include text next to the icon for clarity.

@karmatosed karmatosed removed the Needs Design Needs design efforts. label Jul 29, 2018
@slimmilkduds
Copy link

After deleting 50+ reusable blocks today I can not stress enough the importance of at least some initial implementation of this. It doesn't need to be fancy in my world, just access to wp-admin/edit.php?post_type=wp_block would be plenty good to start with. My 5 cents :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants