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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Second Level Nav


Reply


3 Posts   836 Views

Avatar
unicorn7

Community Member, 9 Posts

27 October 2009 at 11:15pm

Hi Gang

Just about to implement the second level nav which looks pretty easy. I am keen to have the off state graphic for each of my second level items to be an independent graphic i.e. green for the first listed item, blue for the second etc. I am happy for the over state and the on state to be the same colour for each. my products are colour coded so it would help users if they could see the colour to help identify. once they are on the page the colour will be obvious in the background image so the on state can resort to one of the two company brand colours.

is this easy (does any code exist for this function) or do i need to know a fair bit about php to instigate such a thing?

cheers
unicorn7

Avatar
zenmonkey

Community Member, 532 Posts

28 October 2009 at 2:52am

Well the easiest way would be to add that graphic or option to your DataObject. That way you could just call the optional graphic or CSS class from Children Control.

<ul>
<% control Menu(1) %>
<li><a href="$Link">$MenuTitle.XML</a>

<% if Children %>
<ul>

<% control Children %>
<li><a href="$Link" class="$CssOption">$MenuTitle.XML</a></li>
<% end_control %>

</ul>
<% end_if %>

</li>
<% end_control %>
</ul>

Avatar
unicorn7

Community Member, 9 Posts

30 October 2009 at 12:12am

thanks Zenmonkey

I'll give your advice a test run on my staging server once I have the site up and running with the standard menu look.

much appreciated.

unicorn7