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