Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Can the navigation menu items be reordered?

mattmatt ✭✭
edited June 2012 in Vanilla 2.0 - 2.8

Can the navigation menu items be reordered or rearranged?

Either through the admin interface, or through a method exposed to a plugin?

Tagged:

Best Answer

  • peregrineperegrine MVP
    edited June 2012 Answer ✓

    you can put something like this in config.

    $Configuration['Garden']['Menu']['Sort'] = array('Discussions', 'Conversations', 'User', 'Questions', 'Activity', 'Applicants', 'Dashboard');

    you can reorder in plugin as well, I suppose by setting config

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • peregrineperegrine MVP
    edited June 2012 Answer ✓

    you can put something like this in config.

    $Configuration['Garden']['Menu']['Sort'] = array('Discussions', 'Conversations', 'User', 'Questions', 'Activity', 'Applicants', 'Dashboard');

    you can reorder in plugin as well, I suppose by setting config

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • mattmatt ✭✭

    Thanks very much.

  • peregrineperegrine MVP
    edited June 2012

    profile tabs also ala businessdad:

    $Configuration['Garden']['ProfileTabOrder'] = array('MyTab', 'Discussions', 'Thanks', 'Comments', 'Votes');

    http://vanillaforums.org/discussion/comment/162956/#Comment_162956

    more on plugin ala gary mardell
    http://vanillaforums.org/discussion/9725/menu-position-code-advice

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited June 2012

    figured I'd add this here from another thread on sorting on items

    e.g. to put who's online at the the top followed by...

    $Configuration['Modules']['Vanilla']['Panel'] = array('WhosOnlineModule', 'TagModule', 'BookmarkedModule', 'CategoriesModule', 'GuestModule', 'Ads');
    

    from the documentation:

    Organizing Module Sort Order
    
    You can organize the order that modules appear in assets by manipulating the Modules collection of the Configuration array. Take a look at conf/config-defaults.php to see the default sort order of core-packaged modules:
    
    // Modules
    $Configuration['Modules']['Vanilla']['Panel'] = array('NewDiscussionModule', 'GuestModule', 'Ads');
    $Configuration['Modules']['Vanilla']['Content'] = array('Gdn_MessageModule', 'Notices', 'Content', 'Ads');
    $Configuration['Modules']['Garden']['Content'] = array('Gdn_MessageModule', 'Notices', 'Content', 'Ads');
    $Configuration['Modules']['Conversations']['Content'] = array('Gdn_MessageModule', 'Notices', 'Content', 'Ads');
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • mattmatt ✭✭

    @peregrine how about sorting the Custom Menu, the one created for menu items added by plugins?

  • matt said:
    @peregrine how about sorting the Custom Menu, the one created for menu items added by plugins?

    I've run into the same dilemma.

    try this - if you are successful - post here.
    http://vanillaforums.org/discussion/9725

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • mattmatt ✭✭
    edited June 2012

    That doesn't work for me, the order on the front end remains unchanged.

    I kind of expected that as the system menu links are written first, and the {custom_menu} is written afterwards in the template.

    As a workaround I just moved the position of {custom_menu} in my theme template

  • mattmatt ✭✭

    As a side note, I was never able to get the config sort to work, either:

    $Configuration['Garden']['Menu']['Sort'] = array(...);

  • matt said:
    That doesn't work for me, the order on the front end remains unchanged.

    I kind of expected that as the system menu links are written first, and the {custom_menu} is written afterwards in the template.

    As a workaround I just moved the position of {custom_menu} in my theme template

    seems like the easiest way in smarty template.

    the menu sort doesn't seem to work with smarty templates, but it will work for non-smarty themes like the default theme.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • mattmatt ✭✭

    Good to know, thanks

  • peregrineperegrine MVP
    edited June 2012

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.