Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Themes

Discuss SilverStripe Themes.

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

Menu with parent and child pages always showing


Reply

4 Posts   1895 Views

Avatar
jloafs

23 January 2011 at 2:08pm Community Member, 15 Posts

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.

Avatar
Willr

23 January 2011 at 5:12pm Forum Moderator, 5511 Posts

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.

Avatar
jloafs

23 January 2011 at 7:34pm Community Member, 15 Posts

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.

Avatar
jloafs

23 January 2011 at 8:26pm Community Member, 15 Posts

Actually, just got it.

Fantastic.

Thanks for your help.