The MU forums have moved to WordPress.org

order of submenus (7 posts)

  1. quenting
    Member
    Posted 17 years ago #

    With plugins and stuff, some menus of the admin panel start being crowded (typically the manage thing).
    I'd like to reorganize the order of the submenus, but can't figure how to do it.
    So, when I add a submenu from a plugin, how can i choose in what position it'll appear ?

  2. Ovidiu
    Member
    Posted 17 years ago #

    yeah, alphabetically would be a nice thing to have :-(

  3. quenting
    Member
    Posted 17 years ago #

    well, i found out it can be done without too much problems, although it's not too clean. You need to write another add_submenu_page (call it like my_add_submenu_page ), pass it a parameter position, and instead of the $submenu[$parent][] inthere use $submenu[$parent][$pos], the position being a number that's not yet used in menu.php . Then loop through your plugins and replace the add_submenu_page with your my_add_submenu_page to put your own submenus wherever you want.

  4. Ovidiu
    Member
    Posted 17 years ago #

    can you also tell me how I would order the standard wpmu menues alphabetically? right now it seems like they get ordered by "activation time" aka the latest activated plugin is the last in my list, which make using the menues kinda difficult..

  5. quenting
    Member
    Posted 17 years ago #

    well using the method i gave you can give each plugin a number that will define its order of appearance in the list. However to reorder the whole menu alphabetically, including the default menus, I'm not too sure.
    Maybe try creating a plugin with a function doing :
    global $menu;
    sort($menu);

    However I'm not sure to to call this function after all menus have been added and before the menu is actually rendered...

  6. lunabyte
    Member
    Posted 17 years ago #

    I do agree that the sub menus can get crowded fast.

    I took the sub menu, and placed it down the left side.

    Then made a new class called wrapper in the admin css, which was a direct copy of the .wrap style.

    Then took any reference to something like wrap h2, and made it wrap h2, wrapper h2 (etc).

    Then, edited the sub menu's css to make it flow down the side, and edited the wrap class to make it accommodate the menu on the left. (I edited wrap for this, since there are more pages with sub menus than not.)

    Finally, some pages don't have sub menus, some do. Some can go either way. For the ones that "always" have a sub menu, nothing to do (why I edited wrap class). For the ones that could go either way, like the dashboard, I added a variable in menu-header and set it to false. Then in the call for the sub menu I set that var true. Then for those pages where it's a toss up, I added an if check inside the class="" area (where it said wrap).

    I did have to edit the padding on a couple of things, because of an overlap with the post box content and the right menus when on post/add link, etc.

    So that helped with the clutter, and keeps a long list of sub-menu tabs from wrapping to a new line and mucking up.

    Now for the order, I hadn't really thought about it. For me at least, I prefer to keep them the way it is. This way users that are familiar with WP don't get too confused and can distinguish between WP menus and added plugin menus.

  7. Jaqueline
    Member
    Posted 16 years ago #

    I don´t know if I'm in the right place, but digging into the forum, this was the closest subject to my question. I was wondering if there is a way to make all the objects from the menu and submenu appear in a page.

    My idea is to create a page named "Advanced Options", so, everything will appear there, and I don´t have to "clean out" the menu for all the users, because I know some already are familiar with wordpress, but even so, I have some friends who will use it and were complainning about the "complexity" of the menu.

    For now, what I did was make a colorful menu (here:http://morefashion.net/screen-admin.png), very simple, with view site, write post, edit post, edit profile, change template, add link... and then I changed the normal menu to the bottom of the page, but it´s not the right solution.

    I would really apreciate any hint on how to transform the menu into a "page". I already could add the new page to the menu, in a previous test, but the rest of the menu is kind of complex. I already thought of making a page, writting down the menu options, but the problem is that new plugins install new options, and everytime I would have to edit the "advanced options page" again. If someone can tell me where to start, I can go further.

    Thanks a lot!

    Jackie

About this Topic

  • Started 17 years ago by quenting
  • Latest reply from Jaqueline