1320 Posts in 378 Topics by 500 members
|Go to End|
15 May 2009 at 9:08am Last edited: 15 May 2009 9:53am
Hey hows it going guys? I just started using silverstripe its pretty nice I like it. I am trying to use a control block for my nav in the header but I want the first and last items in the nav to have special css classes/styling can this be done and some tips would be much appreciated .Thank you in advance.
Just found out about using < % If first %> but it duplicates the first element !!!!
Ok so I think I solved my own problem
<% control Menu(1) %>
<% if first %>
<li class="wider "><span> </span><a href="#">$MenuTitle</a></li>
<% else_if last %>
<li class="wider no_background"><span> </span><a href="#">$MenuTitle</a></li>
<% else %>
<li><span> </span><a href="#">$MenuTitle</a></li>
<% end_if %>
<% end_control %>
I ended up using ifs and else ifs and it stopped the duplicating
Plz do not mark this as spam I am sure this will help a fellow beginner
24 June 2009 at 5:44pm
this is the way you have to do it, thanks for posting the hack.
|Go to Top|