Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I was just wondering if there is a way to have my dashboard only allow block placement in two wider columns instead of three?
Thanks..
..J..
Comments
Comment #1
ThisIsntSparta CreditAttribution: ThisIsntSparta commentedYou'd have to edit dashboard.css and templates/dashboard-page.tpl.php
I suppose you'd have to take out the middle column in dashboard-page.tpl.php and move the php code there to one of the others.
in the css just edit the column to something like this..
Comment #2
jakemac53 CreditAttribution: jakemac53 commentedThanks for the post, I was also running into the same issue. I took This one step further and actually added columns. I can't link since its not live, but basically I have a layout with a sidebar on the left (1/3 width approx) and a sidebar floating to the right of it (approx 2/3 width). Below the wider sidebar are actually 2 more sidebars (both approx 1/3 width). This allows for a bit more customization by the user without making things to complicated for development. Also there is a 5th column below all of them that is 100% width so that they can add wide widgets into there.
First, you need to change the markup in dashboard-page.tpl.php like described by ThisIsntSparta. Nothing crazy here just added 2 more columns.
Then, you will need to open up dashboard.js, around line 24 for me you will see the following code:
Simply add the 2 additional columns here so they get sent with the ajax request and saved:
Now you will need to open up dashboard.page.inc and edit the dashboard_widget_reorder() function, which looks like the following:
Simply change the range in the foreach statement to be 0-4 (for all 5 columns):
Now you will have 5 columns, simply style them with css to make it look nice, I did the following which also styles the add widget page a bit:
And you are done! You can use this technique to add as many columns as you want.
Comment #3
plopesc