Jump to:

5453 Posts in 1674 Topics by 1198 members

Customising the CMS

SilverStripe Forums » Customising the CMS » customising menus

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

Page: 1
Go to End
Author Topic: 1710 Views
  • archiseek
    Avatar
    Community Member
    1 Post

    customising menus Link to this post

    I have the following site structure

    main menu item 1
       sub menu item 1
       sub menu item 2
       sub menu item 3
       sub menu item 4

    main menu item 2
       sub menu item 1
       sub menu item 2
       sub menu item 3
       sub menu item 4

    main menu item 3

    when in main menu item 1, the side nav shows the children pages
       sub menu item 1
       sub menu item 2
       sub menu item 3
       sub menu item 4
       
    when in sub menu item 1, i want it to show its "sibling" pages ie
       sub menu item 2
       sub menu item 3
       sub menu item 4
       
       

  • banal
    Avatar
    Community Member
    901 Posts

    Re: customising menus Link to this post

    Use <% if LinkOrCurrent = current %> to see if the page is currently active.
    Something like

    <ul>
    <% control Menu(1) %>
    <% if LinkOrCurrent = current %>
    <% else %>
    <li><a href="$Link">$Title</a></li>
    <% end_if %>
    <% end_control>
    </ul>

    1710 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.