Jump to:

23376 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » control menu 2 doesn't work

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1226 Views
  • bebabeba
    Avatar
    Community Member
    192 Posts

    control menu 2 doesn't work Link to this post

    Hi!
    I have a problem width second level menu..
    help please.. I see nothing..

    <table border="1" cellpadding="0" cellspacing="0" width="100%">
       <tr>
       <% control Menu(1) %>
       <td width="14%" valign="top">
       $MenuTitle
       </td>
       <% end_control %>
       </tr>
       
       <tr>
       <% control Menu(2) %>
       <td width="14%" valign="top">
       $MenuTitle
       </td>
       <% end_control %>
       </tr>
       
    </table>

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: control menu 2 doesn't work Link to this post

    Menu2 will only return pages if you are on the second level (or greater) and the sibling pages are allowed to be shown in menus.

    If you're on a top level page then you won't see a menu 2.

  • wmboy
    Avatar
    Community Member
    3 Posts

    Re: control menu 2 doesn't work Link to this post

    If you do want to show a menu 2 control on any page by itself, there is a way around it;

    <% control Menu(1) %>
    <% if Children %>
    <ul>
    <% control Children %>
    <li><a class="$LinkingMode $MenuTitle" href="$Link" title="Go to the {$Title} page">$MenuTitle</a></li>
    <% end_control %>
    </ul>
    <% end_if %>
    <% end_control %>

    1226 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.