Fixing multiple dashboard widget columns
-
This CSS ‘fixes’ the ‘responsive’ multi-column dashboard widget nonsense:
<style type="text/css"> #wpbody-content #dashboard-widgets .postbox-container { width: 100%; } .empty-container { display: none; } </style>
-
Hi Robert,
Just tagged 1.0.2 with your patch. Thanks for your effort!
I’m confused about the goal of this CSS. On my site, it causes the “At a Glance” and “Activity” boxes to be 2 columns wide (instead of the normal 1 column) and pushes down the right-column boxes. Removing that CSS from the bottom of wp-admin.min.css restores the proper width of the boxes (1 column) and overall layout of my Dashboard.
Can you provide some screenshots you I don’t really get what you mean.
WP up though 3.7 allowed setting the number of columns of dashboard widgets (1, 2, 3, or 4). WP 3.8 automagically decides the number of columns: 1 for mobile, 2 for (small) laptop-sized screens, 3 for large laptops / large desktop screens, etc. *Some* of us would like that control back. *I* have a ‘small’ laptop AND desktop screen (1024 pixels wide each), and use dashboard widgets that just don’t look right when squeezed down to 500 or so pixels. The *ideal* solution would be to restore the screen option for the number of columns of dashboard widgets. I don’t know if the WP team is going to do that or not.
The snippet of CSS forces dashboard widgets to be full width and to have only a single column of dashboard widgets. And gets rid of the empty widget place holder.
@robert Heller
Restoring those options would be great to have feature as i prefer to have 2 columns myself, but I guess it is quite a bit work knowing that dashboard got a makeover.
PS: I don’t have that much time right now so I’m only trying to concentrate on the most important sections, but if anyone has a solution im adding fixes instantly so please share them and will push them as fast as possible.
Thanks!
Ah, I see; at a certain (wide–1201px) window width, WP forces the multiple columns into one single column[1], but then “forgets” to resize the “At a Glance” and “Activity” widgets to match.
I think the “correct” solution is to wrap Robert’s code in another media query so that it only affects the >1200px case, to match the other media queries for window-width and columns already in the wp-admin.min CSS file:
@media only screen and (min-width:1201px){ #wpbody-content #dashboard-widgets .postbox-container {width: 100%;} .empty-container { display: none;} }
If I replace the existing declaration from Robert in wp-admin.min.css with the block above, window-widths ≥1201 have full-width “At a Glance” and “Activity” widgets, and widths ≤1200 behave more-or-less as in WP3.7.
This obviously doesn’t restore full user control of number of columns, but it also doesn’t completely force [b]all[/b] window-widths to a single column like the CSS in the plugin currently does.
Robert, does my suggested code “fix” your usecase, or did I misunderstand and you wanted a single column on all screen sizes?
[1] Which seems dumb/backwards, since with a wide window, it seems like you’d want multiple (narrower) columns rather than a single super-wide one! But I don’t think simple CSS changes will let us undo this dumb WP design decision.
@sardisson: *my* use case is *always* a single column. Both of the computers I use (IBM Thinkpad X31 laptop and a 17″ monitor on my desktop) have the same pixel width: 1024.
The ‘new’ WP looks really *weird* on my screens. By *default* the base WP 3.8 dashboard has one 1/2 width column with all of the widgets on the left (stacked vertically) and an empty box all by itself on the right. Many of the dashboard widgets I have are scrunched too narrow (there are some bar graphs from the Download Monitor plugin I use, that just don’t work as narrow widgets). The dashboard (asside from the equally awful color scheme) looks really terrible that way.
I really hope the WP team re-thinks this dashboard design disaster. Taking column count screen option out is a terrible mistake. They *could* restore the option with a option for ‘automatic responsive columns’ or something along with a ‘fixed column count’ option. That way, they can have their ‘modern’ automatic responsive column feature for those that use a wide range of devices (eg iPhone on thr go, and big iMac screen at home/office, etc.) and a fixed number of columns for people like me, who are using ‘old’ UI techology (small laptop and ‘small’ old 4×3 VGA monitor).
What if the plugin were to add a “Number of Columns” option like the old admin (or, if it’s possible and still in the options db somewhere, read the old admin’s option value) and then load some supplementary CSS/stylesheets to display columns sanely based on that setting?
—
I really hope the WP team re-thinks this dashboard design disaster. Taking column count screen option out is a terrible mistake. They *could* restore the option with a option for ‘automatic responsive columns’ or something along with a ‘fixed column count’ option. That way, they can have their ‘modern’ automatic responsive column feature for those that use a wide range of devices (eg iPhone on thr go, and big iMac screen at home/office, etc.) and a fixed number of columns for people like me, who are using ‘old’ UI techology (small laptop and ‘small’ old 4×3 VGA monitor).
I think, combined with your hardware situation/use case description from above, that sounds like a reasonable feature request (speaking not as a WP developer, but as a one-time software developer on another open source project) and compromise between the responsive goals and the hardware realities. Have you filed it in Trac?
I think such feature could be added but I know WP Team reworked whole Dashboard so I’m not sure how the columns are handled at the moment and this would probably require quite a few hours of investigation.
Will keep this in mind, would be happy myself to have columns restored for dashboard.
@sardisson: I put in a feature request in Trac: https://core.trac.www.ads-software.com/ticket/26780, in case anyone else wants to add ideas or thoughts.
Robert, have you seen this plugin: https://wptavern.com/how-to-set-up-1-or-2-columns-for-wordpress-dashboard-widgets ? I just learned about it and it sounds like it might do exactly what you want.
- The topic ‘Fixing multiple dashboard widget columns’ is closed to new replies.