Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Menu with parent and child pages always showing

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1762 Views
  • jloafs
    Avatar
    Community Member
    15 Posts

    Menu with parent and child pages always showing Link to this post

    I'm a total SS newb and a graphic designer by trade so I'm a touch out of my depth – trying to pick it up as I go along.

    I'm trying to build a site navigation that works like this example: http://www.everythingdesign.co.nz/test/la-cigale/

    I need to have the Main pages and subpages always visible. I've been through the initial tutorials and got to the stage where I have a submenu appearing on the parent pages but I need to weave the two menus together and keep them visible.

    The way I constructed the example menu above was to put each group of 'Main and sub menu' in a div of its own so that I could use the bottom border in css to seperate them. There may be a better way to do that too.

    Can anybody help?
    Cheers.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Menu with parent and child pages always showing Link to this post

    Could you post the code you've used for so far? If you want to whole submenu shown of each main level menu then you can do something like

    <% control Menu(1) %>
    <a href="$Link">$MenuTitle</a>
    <% control Children %>
    <a href="$Link">$MenuTitle</a>
    <% end_control %>
    <% end_control %>

    http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls has all the information about the available controls.

  • jloafs
    Avatar
    Community Member
    15 Posts

    Re: Menu with parent and child pages always showing Link to this post

    Thanks Willr.

    Definitely getting there with your code.

    At the moment I've got:

       <div id="left">
          <div class="menu">
    <% control Menu(1) %>
    <a class="menu bold" href="$Link">$MenuTitle</a>
    <% control Children %>
    <a class="menu" href="$Link">$MenuTitle</a>
    <% end_control %>
    <% end_control %>
             
          </div>
    </div>

    I just need to organise each grouping into seperate divs somehow. Again, any ideas would be much appreciated.

    Thanks.

  • jloafs
    Avatar
    Community Member
    15 Posts

    Re: Menu with parent and child pages always showing Link to this post

    Actually, just got it.

    Fantastic.

    Thanks for your help.

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