Skip to content

Add SlotFills to Document Sidebar #13357

Closed

Description

@ryanwelcher

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.

Activity

  1. adamsilverstein commented on Jan 17, 2019

    @adamsilverstein
    Member

    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.

  2. added
    Needs Design Feedback
    on Jan 17, 2019
  3. ryanwelcher commented on Jan 17, 2019

    @ryanwelcher
    ContributorAuthor

    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.

  4. ryanwelcher commented on Jan 17, 2019

    @ryanwelcher
    ContributorAuthor

    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.

  5. gziolo commented on Jan 21, 2019

    @gziolo
    Member

    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/

  6. added
    [Status] Blocked
    [Feature] Extensibility
    on Jan 21, 2019
  7. added this to the Future: Phase 2 milestone on Jan 21, 2019
  8. swissspidy commented on May 17, 2019

    @swissspidy
    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.

  9. added
    [Feature] Document Settings
    on May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Design Feedback[Feature] Document Settings[Feature] Extensibility[Status] Blocked

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions