Jump to:

324 Posts in 153 Topics by 156 members

Migrating a Site to Silverstripe

SilverStripe Forums » Migrating a Site to Silverstripe » How to set up Sub-sub-menu to my site??

What you need to know when migrating your existing site to SilverStripe.

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

Page: 1
Go to End
Author Topic: 1944 Views
  • justcomde
    Avatar
    Community Member
    2 Posts

    How to set up Sub-sub-menu to my site?? Link to this post

    Hello everyone,

    i was asking myself how to implement a sub-sub-menu to my site. I am quite new to silverstripe and don't know how to do that.

    This is how the actual sub-menu is looking:

    <% if Menu(2) %>
    <div id="Menu2Top">
    <% control Level(1) %>
    <h2><a href="$Link">$Title</a></h2>
    <% end_control %>
    </div>
    <ul id="Menu2">
    <% control Menu(2) %>
    <li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a></li>
    <% end_control %>
    </ul>
    <% end_if %>

    What do i need to do?

    I tried this one here, but didn't work out:

    <% if Menu(2) %>
    <div id="Menu2Top">
    <% control Level(1) %>
    <h2><a href="$Link">$Title</a></h2>
    <% end_control %>
    </div>
    <ul id="Menu2">
    <% control Menu(2) %>
    <li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a>
    <% if Children %>
    <ul>
    <% control Children %>
    <li class="$LinkingMode"><a href="$Link" title="$Title.XML">$MenuTitle</a></li>
    <% end_control %>
    </li>
    <% end_control %>
    </ul>
    <% end_if %>

    Am I missing something? Anyone got a clue how to make it work?

    Thanks in advance,

    m-obi

  • justcomde
    Avatar
    Community Member
    2 Posts

    Re: How to set up Sub-sub-menu to my site?? Link to this post

    I tried a little harder and came to THE solution. For anyone who has the same problems, just do it this way:

    <% if Menu(2) %>
    <div id="Menu2Top">
    <% control Level(1) %>
    <h2><a href="$Link">$Title</a></h2>
    <% end_control %>
    </div>
    <ul id="Menu2">
    <% control Menu(2) %>
    <li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a>
    <% if Children %>
    <ul>
    <% control Children %>
    <li class="$LinkingMode"><a href="$Link" title="$Title">$MenuTitle</a></li>
    <% if LinkOrSection = section %>
    <% if Children %>
    <% end_if %>
    <% end_if %>
    <% end_control %>
    </ul>
    <% end_if %>
    </li>
    <% end_control %>
    </ul>
    <% end_if %>

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