-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 a way to force top toolbar #15264
Comments
+1 |
This would be very useful - we've had occasions where forcing some styles mean the inline block toolbar is off screen in some scenarios unless you hide the right settings panel. This option would work solve this. +1 |
Any updates on this? It's made more difficult currently by having to hide the option with CSS and as there are no unique identifiers on the toolbar, spotlight and full screen options and so you need to do the hiding based off the first option, which might not always be top toolbar in future. If anyone is look for the JavaScript part of this see: https://stackoverflow.com/a/63157946/1951359 |
Does anyone know where the data is stored if a user has selected an option like top toolbar, spotlight or fullscreen mode, I can't find this in sessions, user meta, cookies, etc yet on refresh WordPress remembers the previously set setting? @swissspidy @altechzilla |
Sorry @ninetyninew , it's been a while since I used Gutenberg/WP. |
@altechzilla It's okay I found it, if anyone else is looking for this all the Gutenberg option data is set in WP_DATA_USER[user id] in local storage. |
Here is a way I ended up doing this. To note, I don't like it. It's hacky, but until they come up with a way to force top toolbar this is the best solution I've got. The solution comprises of two steps:
Modern Javascript (Webpack/Babel)
Regular Javascript
CSS (Use
If this solution is incomplete let me know, but it is working for my use case. |
@KernelZechs Yes, this is pretty much what I was getting at and i've done similar myself - it's really hacky without identifiers to hide the option. A good old fashioned filter would be good for this :D |
I was about to open a bug report about this, because to me this is a bug / missing obvious feature. |
Is your feature request related to a problem? Please describe.
In one of our projects we heavily change the writing flow in Gutenberg. Blocks can be dragged around, rotated, resized, etc.
With such a UI, the block toolbar creates unnecessary noise and activating the top toolbar (aka fixed toolbar) makes more sense for us.
However, there's no way to programmatically force the top toolbar to be active.
Describe the solution you'd like
Similar to #14647, there could be an option/filter to force the top toolbar to always be active. If that is used, there would be no option for the user to switch between fixed toolbar and regular toolbar in the options menu.
Describe alternatives you've considered
An alternative would be to hide the toolbar options via CSS and change the toolbar mode upon script loading using
dispatch( 'core/edit-post' ).toggleFeature( 'fixedToolbar' )
.However, this does not prevent some other scripts from also running
dispatch( 'core/edit-post' ).toggleFeature( 'fixedToolbar' )
, so we'd have to monitor any changes, which is not ideal.The text was updated successfully, but these errors were encountered: