Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Show complete menu system in footer

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1064 Views
  • doubleedesign
    Avatar
    Community Member
    19 Posts

    Show complete menu system in footer Link to this post

    Hi all,

    I'm new at SilverStripe but am liking it a lot so far. I've got a 2-level navigation system going fairly easily as per the basic site tutorial, ie. the section names are the first level and then as you open those pages, the second level menu appears.

    I'd like to show the complete menu system in the footer as well, eg. several columns with a first-level link at the top of each column and then the relevant second-level links below it. Eg. Say I had 3 first-level links, Home, About and News. And within About was Our History, Staff and Locate Us. In the footer, Home About Us and News would be along the top, and then History, Staff and Locate Us would be below About Us.

    I've tried searching the forums but haven't been able to work out how to do it. Any suggestions would be most appreciated.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Show complete menu system in footer Link to this post

    Well if you want columns of all the pages then its quite simple, just loop over the top level menu and for each item display the children.

    Note to make it shorter I have left out the list item html you should use as well.

    <% control Menu(1) %>
    <div class="column">
    <a href="$Link">$MenuTitle</a>

    <% control Children %>
    <a href="$Link">$MenuTitle</a>
    <% end_control %>
    </div>

  • doubleedesign
    Avatar
    Community Member
    19 Posts

    Re: Show complete menu system in footer Link to this post

    Thanks Willr, that should be better than what I ended up coming up with, which was too specific in terms of the level 1 links and had to use a table:

    <table>
           <tr>
            <% control Menu(1) %>
            <th>
        <a class="$LinkingMode" href="$Link" title="Go to the &quot;{$Title}&quot; page">$MenuTitle</a>
        </th>
        <% end_control %>
        </tr>
        <tr>
        <td>
           <% control ChildrenOf(level-1-link-1 %>
              <li class="$LinkingMode"><a href="$Link" title="Go to the &quot;{$Title}&quot; page">$MenuTitle</a></li>
           <% end_control %>
        </td>
        <td>
           <% control ChildrenOf(level-1-link-2) %>
              <li class="$LinkingMode"><a href="$Link" title="Go to the &quot;{$Title}&quot; page">$MenuTitle</a></li>
           <% end_control %>
        </td>
        </tr>
        </table>

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