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

SlotFills: Proposal to add a slot to the header toolbar #49850

Closed
t-hamano opened this issue Apr 16, 2023 · 3 comments
Closed

SlotFills: Proposal to add a slot to the header toolbar #49850

t-hamano opened this issue Apr 16, 2023 · 3 comments
Labels
[Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API [Package] Plugins /packages/plugins [Type] Enhancement A suggestion for improvement.

Comments

@t-hamano
Copy link
Contributor

What problem does this address?

A large space exists in the header of the post editor. Some developers have added plugin-specific links or buttons to this space.

However, since there is no Slot here, developers have no choice but to insert contents directly by writing code like the following (this code can be tried from the browser console)

const headerToolbar = document.querySelector('.edit-post-header-toolbar');
const customHeaderToolbarArea = document.createElement( 'div' );
customHeaderToolbarArea.textContent = 'Custom Content';
headerToolbar.appendChild( customHeaderToolbarArea );

custom-content

What is your proposed solution?

I think adding a slot like PluginHeaderToolbar would help many developers.

Example of plugins adding content to this area

Extendify — Gutenberg Patterns and Templates

extendify

Gutenberg Blocks by Kadence Blocks – Page Builder Features

kadence-blocks

Translate Multilingual sites – TranslatePress

translatepress

Genesis Blocks

genesis-blocks

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API [Package] Plugins /packages/plugins labels Apr 16, 2023
@aaronrobertshaw
Copy link
Contributor

It is worth noting there is ongoing work being done to overhaul the Top Toolbar. There is a pretty high likelihood that directly injecting elements in this unexpected manner will conflict there (open PR). Lack of horizontal real estate is already an issue with those proposed enhancements without plugins adding more items.

I'd suggest it might be better if we don't further encourage adding items to the toolbar until we see what results from the above issue and PR.

@Mamaduka
Copy link
Member

@t-hamano, this might be a duplicate of #16988.

P.S. Here's a general discussion on extensibility - #37448.

@t-hamano
Copy link
Contributor Author

@Mamaduka Thanks for the info!
I would like to close this issue because it raises the same thing as #16988.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API [Package] Plugins /packages/plugins [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants