HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla 2.1 release candidate

2»

Comments

  • LincLinc Detroit Admin

    Selectively answering the last part: yes, sort works regardless of template language. That happens in the framework before the view is rendered.

    peregrine
  • peregrineperegrine MVP
    edited April 2014

    @Lincoln said:
    Selectively answering the last part: yes, sort works regardless of template language. That happens in the framework before the view is rendered.

    sort via config statement: ?

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

    doesn't seem to work for me., can someone show me a screenshot of a sorted menu with a default.master.tpl theme.

    and the the config statement that worked sorting the menu displayed in your screenshot.

    just to humor me. :wink:

    apparently no one can prove it :).

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I Can corroborate that menu sort does not work on a mobile tpl or regular tpl. It works on all my php themes including mobile, but does not work on tpl template .

    $Configuration['Garden']['Menu']['Sort'] = array('New Discussion', 'Dashboard', 'Gallery', 'Games', 'Activity', 'Conversations', 'Discussions', 'Categories', 'Questions', 'Applicants', 'User', 'EditProfile','Inbox','Home', 'Mobile View', 'VChat', 'SignIn', 'SignOut', 'Contact','Gallery','Games', 'Privacy');

    I suspect it is because the menu is not the menu it is called banner ?

    peregrine
  • peregrineperegrine MVP
    edited April 2014

    thank you for corroborating. :)

    and in a php based theme the config statement . will not sort naviagation menu items added via addlink,

    nor will it add the select class to those Navigation Menu items that were added via addlink in a plugin, it will however add the Active class to menu items in dashboard panel

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2014

    Yes they will sort as long as you add the link in the statement where you want it to show.

    I just did an experiment, I replaced all the Banner in the embed friendly tpl and css for Menu and I got to sort a couple of them.The sign out link and the dashboard link .

    I think this must have something to do with it. The order that they appear in the theme hooks is not how it shows, so something is getting sorted

    these are the links I added in the themehooks

    $Sender->Menu->AddLink('Categories', T('Categories'), '/categories/all');
    $Sender->Menu->AddLink('Home', Img('themes/TinyEmbedFriendly/design/images/hicon.png', array('title' => T('Home'))), 'http://www.yoursite.com',  array('class' => 'Button'));
    $Sender->Menu->AddLink('Games', Img('themes/TinyEmbedFriendly/design/images/smile.png', array('title' => T('Games'))), 'plugin/Games',  array('class' => 'Button'));
    $Sender->Menu->AddLink('NewDiscussion', Img('themes/TinyEmbedFriendly/design/images/new.png', array('title' => T('Start New Discussion'))), 'post/discussion',  array('class' => 'Button'));        
    $photo = UserPhoto(Gdn::Session()->User);
       $Sender->Menu->AddLink('User',  $photo,  '/profile/{UserID}/{Username}',array('Garden.SignIn.Allow'), array('class' => 'UserNotifications'));
    }
    

    They do not appear in this order however...yea something is funky with the sort

  • peregrineperegrine MVP
    edited April 2014

    are you on a tangent - or are you specifically talking about the config statement, which I am talking about, that doesn't appear to sort things in a tpl file nor does it sort things added via addlink in a plugin, nor does it add a Select class when item is selected if the item is not one of the standard home dashboard activity, etc.

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2014

    Specifically the config statement. Yes and yes. You can also test your theory by using the categories drop down plugin which also does not work on tpl it adds the categories in no particular order.

    I do recall removing the links added by plugins to the menu and coding them by hand in my master php or the theme hooks. Because of this problem. Which seems to apply to sorting modules as well....

  • peregrineperegrine MVP
    edited April 2014

    I do recall removing the links added by plugins to the menu and coding them by hand in my master php or the theme hooks. Because of this problem

    yes there are workarounds. doesn't change the issue at hand though.

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

  • LincLinc Detroit Admin

    Try $Configuration['Modules']['Vanilla']['Menu']?

  • @Lincoln

    Try $Configuration['Modules']['Vanilla']['Menu']?

    had no impact on ordering for my test in vanilla 2.1rc1

    I don't want to de-rail the whole discussion, just thought I would post some of the issues related to menu selection and ordering in tpl themes and with plugin additions of addlinks, if it is something you guys think should work.

    should I file on github?

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @Lincoln said:
    Try $Configuration['Modules']['Vanilla']['Menu']?

    Yea tried that too, also other combos . I did change the tpl and theme hooks to not use Banner and use Menu that seems to help a bit also some other things work on the menu. Why is it called Banner in the mobile and the embed friendly ?

    I am sure this is related to how smarty compiles the stuff.

  • LincLinc Detroit Admin

    @peregrine said:
    should I file on github?

    Sure, can't hurt. If you happen to know if it happens in master/2.2 also that'd be helpful.

  • LincLinc Detroit Admin
    edited April 2014

    @UnderDog said:
    Besides that issue with the SQL statement (see http://vanillaforums.org/discussion/comment/206209/#Comment_206209) (no bug report yet)

    I am not convinced that's actually a bug yet. I dunno how that SQL is getting built on that site, but it's not like that in core afaik.

  • LincLinc Detroit Admin

    @peregrine said:
    nor will it add the select class to those Navigation Menu items that were added via addlink in a plugin

    Sounds like a good issue to file. Can get looked at for 2.1.1 at least.

Sign In or Register to comment.