Hi all,
On a client website I need to display the nav bar on two rows, splitting evenly at the halfway point.
Eg:
Item1 - Item2 - Item3 - Item4
Item5 - Item6 - Item7 - Item8
or
Item1 - Item2 - Item3 - Item4
Item5 - Item6 - Item7
I tried to use
<% if Pos = TotalItems / 2 %> and variations of that but kept getting PHP errors. The generated PHP code showed that the <% if ... %> had not been interpreted (still showed as the <% %> tag) whilst the <% end_if %> tag had been interpreted - causing the error.
below is the code I have been playing with from my Navigation.ss file
<ul>
<% control Menu(1) %>
<% if Pos = TotalItems / 2 %>
</ul>
<ul>
<% end_if %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode">
<% if Pos + 1 = TotalItems / 2 %>
<span class="last">$MenuTitle.XML</span>
<% else_if Last %>
<span class="last">$MenuTitle.XML</span>
<% else %>
<span>$MenuTitle.XML</span>
<% end_if %>
</a></li>
<% end_control %>
</ul>
Can anyone offer some suggestions? I have good PHP skills but my knowledge of Silverstripe is still growing :)
Cheers
James.