Hi everybody,
I have a Problem with $FirstLast inside a self made if statement.
To assign a Page to a certain Menu on my Webpage I created some SettingsFields like:
CheckboxField("ShowInFooterMenu", "Footer")
Everything works fine except that when I create my Footer Menu like:
<% loop $Menu(1) %>
<% if ShowInMenus %>
<% if ShowInFooterMenu %>
<li class="{$FirstLast}">
<a href="$Link" title="$Title.XML">$MenuTitle.XML</a>
</li>
<% end_if %>
<% end_if %>
<% end_loop %>
the FirstLast is not working correctly.
In Silverstripe I got several Pages after my last Footer Page which are not shown in my Footer because of the unchecked ShowInFooterMenu. But FirstLast seems to count them anyway. Am I doing something wrong?
I'm using silverstripe 3.1.2.
Thanks in advance for any help,
Phil