The MU forums have moved to WordPress.org

Defaullt colum on the admin home page (dashboard) (12 posts)

  1. chelgeson
    Member
    Posted 13 years ago #

    By default, when a new user signs up, the dashboard displays 2 columns. I would like to have it display one column by default.

    I found a thread on it...http://mu.wordpress.org/forums/topic/15078?replies=2
    but haven't heard back.

    I found in the wp-admin/includes/template.php file on lines 3594 - 3620 this code..

    function screen_layout($screen) {
    global $screen_layout_columns;

    $columns = array('dashboard' => 4, 'post' => 2, 'page' => 2, 'link' => 2);
    $columns = apply_filters('screen_layout_columns', $columns, $screen);

    if ( !isset($columns[$screen]) ) {
    $screen_layout_columns = 0;
    return '';
    }

    $screen_layout_columns = get_user_option("screen_layout_$screen");
    $num = $columns[$screen];

    if ( ! $screen_layout_columns )
    $screen_layout_columns = 2;

    $i = 1;
    $return = '<h5>' . __('Screen Layout') . "</h5>\n<div class='columns-prefs'>" . __('Number of Columns:') . "\n";
    while ( $i <= $num ) {
    $return .= "<label><input type='radio' name='screen_columns' value='$i'" . ( ($screen_layout_columns == $i) ? " checked='checked'" : "" ) . " /> $i</label>\n";
    ++$i;
    }
    $return .= "</div>\n";
    return $return;
    }

    if I change the line 3609

    $screen_layout_columns = 2;

    to

    $screen_layout_columns = 1;

    It works but for all all post edit and page edit pages as well.
    I want to only have 1 column as the default for the dashboard and not effect the post and page edit pages.

    Can anyone help me?

    Thanks
    Cody

  2. donncha
    Key Master
    Posted 13 years ago #

    Cody - please don't add a url to your sig, it's not allowed on this forum and I have to follow you around cleaning them up.

  3. chelgeson
    Member
    Posted 13 years ago #

    sorry wasnt aware....
    I haven't gotten any responses to my questions (I have responded and started a number of threads now! Still not one piece of help :( and thought it might help if someone could view the site I am asking about.

  4. andrea_r
    Moderator
    Posted 13 years ago #

    If you don't get an answer it means no one knows. Also, there's an "unreplied" tag that some people use to find unanswered questions to see if they can help. Multiple posts just show up multiple times.

  5. chelgeson
    Member
    Posted 13 years ago #

    I have just meant that I have asked multiple different questions in the forum thats all....not posted things over and over again.

    Thanks for the feedback!

  6. chelgeson
    Member
    Posted 13 years ago #

    Does anyone have any ideas about this? Can anyone help me out?

    Cody

  7. andrea_r
    Moderator
    Posted 13 years ago #

    This isn't really mu-specific. If you wrangle all the default dashboard widget to be on one side, then it will show one column.

    Now your only challenge is to set it this way via a plugin and not by hacking the core.

    http://wordpress.org/extend/plugins/dashboard-heaven/
    http://wordpress.org/extend/plugins/adminimize/

    Or hey, even this:

    http://wordpress.org/extend/plugins/wpmu-simple-dashboard/

  8. DeannaS
    Member
    Posted 13 years ago #

    Mine (simple dashboard) doesn't deal with columns. But, it wouldn't be hard to add that. And it's always better to modify someone's plugin than to modify the core.

  9. chelgeson
    Member
    Posted 13 years ago #

    Than you both so much for the response. I already have the simple dashboard plugin installed.

    My issue is making the default dashborad 1 column (the full width of the dashboard page rather than split in half) when a new blog is created. I know the user can rearrange things but I dont want them to have to do that. It is the first thing they see and I right now the default widgets are all on the left and it looks a little silly (scrunched).

    DeannaS you said it would be pretty easy to add to your plugin....do you have a suggestion on what the code would look like? I dont know what to add?

    Thanks

  10. DeannaS
    Member
    Posted 13 years ago #

    *grumble* *grumble*

    It's not quite as easy as one would imagine. Seems the number of columns is stored on a user basis, and while I can get it to update the number of columns for a user, I can't get it to do it on the initial load. It takes effect the second time someone comes to the dashboard.

    Still working on it, though.

  11. DeannaS
    Member
    Posted 13 years ago #

    The almost working way is to add the following inside the cets_simple_dashboard_set() function

    global $user_ID;
    update_user_option($user_ID, "screen_layout_dashboard", 1, true);

    That will set it to 1 column the second time they go to the dashboard.

    I have to work on other stuff so might not get back to this for a while.

  12. chelgeson
    Member
    Posted 13 years ago #

    Thanks so much DeannaS! I really appreciate you taking a look at this. I understand you have some other things to work on but I will keep an eye out for any updates.

    Thanks again
    Cody

About this Topic

  • Started 13 years ago by chelgeson
  • Latest reply from chelgeson