Problem/Motivation
I just updated to 1.0.0-rc6 today and see that the fix per this issue #3394027 is causing a problem when gin_lb and layout_builder_admin_theme are both enabled. The sidebar is fixed, cannot be collapsed, and intrudes into the content area.
I use these two modules together on every site I run and would prefer the arrangement prior to rc6 with the action buttons above the content area.
Can the patch in issue #3394027 be further targeted so that the new enhancements are inactive when layout_builder_admin_theme is enabled?
Thanks.
Steps to reproduce
- Install Gin theme, Gin Layout Builder, Layout Builder Admin Theme, and set Gin as the default Administration theme
- On /admin/appearance/settings/gin, set Navigation (Drupal Toolbar) to "Horizontal, Modern Toolbar", enable "Show Secondary Toolbar in Frontend" and Save
- Enable Layout Builder for some entity display
- Create a page of that entity type and edit the page in Layout Builder mode
- Notice the sidebar is fixed and there are no options to hide, collapse, or reposition horizontally above
Proposed resolution
When Gin Layout Builder and Layout Builder Admin Theme are both enabled:
- My preferred resolution would be to leave the action buttons in a horizontal arrangement above the content area.
- An alternate resolution would be to fix the missing sidebar toggle when Layout Builder Admin Theme is enabled.
- A third possibility is to give the user the option of positioning the action buttons either horizontally above or in a collapsible sidebar. Could this be accomplished as an option in Gin Settings /admin/appearance/settings/gin?
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | gin_lb-3424508-21.patch | 672 bytes | phjou |
| #15 | Screenshot after fix.png | 106.3 KB | solideogloria |
| #8 | Sub-menu is covered.png | 40.78 KB | solideogloria |
| #6 | Screenshot after changes.png | 108.1 KB | solideogloria |
| gin_lb with layout_builder_admin_theme.png | 55.92 KB | goldin |
Issue fork gin_lb-3424508
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
goldin commentedComment #3
stmh commentedThis is also happening for us, and we are not using the layout_builder_admin_theme.
Comment #4
solideogloria commentedComment #5
solideogloria commentedComment #6
solideogloria commentedI am using the Layout Builder Admin Theme module as well. Here are some screenshots, before and after updating Gin Layout Builder.
Before (rc5):
After (rc6):
Notice where I have indicated with red dotted line that the right portion of the blocks are hidden behind the settings sidebar, and I cannot click the edit/configure button for blocks.
JavaScript Errors
In addition, you'll notice that the sidebar itself is a little messed up. The checkbox to create a new revision does not show. There are also some JavaScript errors in the browser console.
Debugging
Uncaught TypeError: Cannot set properties of null (setting 'checked')
In gin_lb_preview_regions.js, these two constants are
null:This appears to happen because the hook
gin_lb_preprocess_toolbar__gin_lbis never called. ThepreprocessToolbarGinLbwould be called in that hook, and that's the function that adds the Preview Regions and Preview Content checkboxes that are missing.Also, I just realized that even after reverting to Gin LB rc5, I still have this JS error, and those two checkboxes still don't show. You can see from the "before" screenshot that they aren't there. I will post a separate issue for this:
#3427472: Preview Regions and Preview Content checkboxes are missing
Comment #7
solideogloria commentedComment #8
solideogloria commentedThe user sub-menu is also unclickable, as when hovering over my username, the sub-menu is covered by the sidebar. Changing the sidebar
.glb-sidebarz-index to101instead of103would fix that.Comment #9
solideogloria commentedShorter title
Comment #10
solideogloria commentedDoes anyone know how to fix this, such as by making the sidebar closable, or by making it push the UI behind it to the left so it can be clicked? It would be nice to have a patch so that I don't have to pin the module to rc5.
Comment #11
solideogloria commentedComment #13
solideogloria commentedI adding
padding-rightto thebodyelement for the layout builder. This is the same thing Gin does on its edit page in its toolbar.scss.Please review to see if the changes fix the issues.
Comment #14
solideogloria commentedThis still needs work, as the Gin sidebar on the edit form has a way to hide it, which is important on small screens and mobile. This sidebar cannot be hidden, so it breaks all useability on small screens, since it cannot be hidden.
Comment #15
solideogloria commentedStill, better than before.
Admins might not need to use this functionality on small screens, so this at least makes it so that you can use the latest version of the module.
Comment #16
goldin commented@solideogloria Testing MR91 and yes it appears to solve the overlap issue with the sidebar. However I am also finding that the contextual links for sections have disappeared (repositioned out of the viewport). I narrowed it down to .layout-builder__section {position: relative;} seems to be missing from gin_lb.css in your fork?
Comment #17
solideogloria commentedCan you tell me what .scss file that would be in? If you look at my changes to files, nothing affected that in an scss file.
Also, is there a way to disable minification of CSS in the yarn build? It's impossible to see what changed in the CSS when it's all minified.
Comment #18
christian.wiedemann commentedHi, Is this still happening in the 3.x branch?
Comment #19
christian.wiedemann commentedComment #20
solideogloria commentedI'm not on Drupal 11 yet.
Comment #21
phjouI have the same issue on Drupal 11.
It seems like when in layout builder I do not have data-drupal-admin-styles or #extra-specificity-hack where the close button is and consequently the styles are not applying.
I created a small patch that works for me by adding the data-drupal-admin-styles attribute on the container of the toolbar but I am not sure that should be the long term solution.
Comment #22
phjouActually I just discovered there is an issue in the latest version of gin. The button doesn't show even with node edit, I used this patch:
https://git.drupalcode.org/project/gin/-/commit/7667bb0b7d3c1bded7622252...
#3567613: Show sidebar toggle is not usable
And it works perfectly now without the patch I shared previously.