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

Add SlotFills to Document Sidebar #13357

Closed
ryanwelcher opened this issue Jan 17, 2019 · 5 comments · Fixed by #13361
Closed

Add SlotFills to Document Sidebar #13357

ryanwelcher opened this issue Jan 17, 2019 · 5 comments · Fixed by #13361
Labels
[Feature] Document Settings Document settings experience [Feature] Extensibility The ability to extend blocks or the editing experience Needs Design Feedback Needs general design feedback. [Status] Blocked Used to indicate that a current effort isn't able to move forward
Milestone

Comments

@ryanwelcher
Copy link
Contributor

ryanwelcher commented Jan 17, 2019

Is your feature request related to a problem? Please describe.
It is less than ideal that the only way to add a custom panel to the sidebar is by registering a meta box. This removes any control developers have over placement in any way with all of the meta boxes appearing at the bottom in the order they are registered.

Describe the solution you'd like
My proposal is to add more slotFills to the panel. Ideally ones between each of the existing panels but at the minimum, one that sits below the Status & Availability panel. This will not allow complete control over placement, but solves the issues of all items going to the bottom of the list.

slotfilllocation

Describe alternatives you've considered
As mentioned, the only other approach ( to my knowledge ) is by registering a meta box.

@adamsilverstein
Copy link
Member

adamsilverstein commented Jan 17, 2019

I love this idea, and your PR solution seems elegant @ryanwelcher - thanks!

I'm curious to hear design feedback on this proposal, I know when we worked on extensibility of the sidebar in the past it was important to consider overall user experience.

Can you describe the use case that led you to this Issue/PR? Better understand use cases for this new slot will help support its adoption.

@adamsilverstein adamsilverstein added the Needs Design Feedback Needs general design feedback. label Jan 17, 2019
@ryanwelcher
Copy link
Contributor Author

Thanks for the feedback @adamsilverstein. The use-case was for a client site where we wanted to add a panel that was rather important to the post being edited. There are a large number of taxonomies associated with the post type and so any custom meta boxes would appear very far down the interface. Overall, this is a question that comes up a lot across the 10up engineering team.

@ryanwelcher
Copy link
Contributor Author

I have updated the PR to ensure that the items being added are placed in a <PanelBody> component instead of relying on the item in the slot to be built that way. The inner content is still up to to the user however.

@gziolo
Copy link
Member

gziolo commented Jan 21, 2019

Copying comment from @youknowriad left on the related PR (#13361 (review)):

Referring to the related slack discussion. https://wordpress.slack.com/archives/C02QB2JS7/p1545318632348900

Let's wait a bit before introducing this as Phase 2 work could have an impact on backward compatibilty here.

I alos commented on the same PR (#13361 (comment)):

Noting, that there is also a tutorial which explains how to create a sidebar for your plugin - it would be an alternative supported as of today:
https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/tutorials/sidebar-tutorial/plugin-sidebar-0.md

There was also a related discussion on Twitter on that topic during the weekend:

https://twitter.com/AlexStandiford/status/1086313778625593344

There was mention of the article by @ocean90:
https://dominikschilling.de/how-to-edit-post-meta-outside-of-a-gutenberg-block/

@gziolo gziolo added [Status] Blocked Used to indicate that a current effort isn't able to move forward [Feature] Extensibility The ability to extend blocks or the editing experience labels Jan 21, 2019
@gziolo gziolo added this to the Future: Phase 2 milestone Jan 21, 2019
@swissspidy
Copy link
Member

Suggestion from @ellatrix in #15695:

So, what I'm proposing is that we add a slot or something similar only for custom post types, as we should make no assumptions on what that post type may need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Settings Document settings experience [Feature] Extensibility The ability to extend blocks or the editing experience Needs Design Feedback Needs general design feedback. [Status] Blocked Used to indicate that a current effort isn't able to move forward
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants