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.

[Solved] How to separate the Menu items?

edited October 2011 in Vanilla 2.0 - 2.8
I'm trying to break the header menu into two groups. I would like the sign in/user data to be encased in its own html. Whats the best way to tackle this? Thanks in advance.

Best Answer

  • ToddTodd Vanilla Staff
    edited October 2011 Answer ✓
    This is exactly what theming is for, I recommend basing your theme off of this theme. The theme uses our more themer-friendly smarty syntax in its default.master.tpl.

    You can see that the menu in the file uses the code:
    <ul id="Menu">
    {dashboard_link}
    {discussions_link}
    {activity_link}
    {inbox_link}
    {profile_link}
    {custom_menu}
    {signinout_link}
    </ul>
    Just seperate out the {inbox_link}, {profile_link}, and {signinout_link}.

    Note that calling these tags will by default put them into <li>..</li> elements. If you don't want this you need to specify a format for the link like this:
    {inbox_link format="<a href="%url" class="%class">%text</a>"}

Answers

  • lucluc ✭✭
    It might be easier to do it via a theme.
    But it might better future proof, to do it via a plugin and a event (if one does exists for that).

    It depends if you just want that change or if you want to do heavy theming work.
  • ToddTodd Vanilla Staff
    edited October 2011 Answer ✓
    This is exactly what theming is for, I recommend basing your theme off of this theme. The theme uses our more themer-friendly smarty syntax in its default.master.tpl.

    You can see that the menu in the file uses the code:
    <ul id="Menu">
    {dashboard_link}
    {discussions_link}
    {activity_link}
    {inbox_link}
    {profile_link}
    {custom_menu}
    {signinout_link}
    </ul>
    Just seperate out the {inbox_link}, {profile_link}, and {signinout_link}.

    Note that calling these tags will by default put them into <li>..</li> elements. If you don't want this you need to specify a format for the link like this:
    {inbox_link format="<a href="%url" class="%class">%text</a>"}
  • Thanks Todd!
Sign In or Register to comment.