Hi All,
I'm having an issue here which I thought was simple enough but for some reason isn't working for me.
I have a page with 5 subpages. I want the title on the mainpage to be 'All Listings' instead of $Title but for the sub pages I want the title to be '$Title'
This is my code now
<% if Level(1) %>
<% control Level(1) %>
<h2>All Listings</h2>
<% end_control %>
<% end_if %>
<% if Level(2) %>
<% control Level(2) %>
<h2>$Title</h2>
<% end_control %>
<% end_if %>
I've tried it without the 'if' and I've tried it without the 'control'
but I get the same result which is on the subpages both titles appear. The 'All Listings' and the '$Title'
I've checked the 'Built-in Page Controls' documentation here http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls
but can't see what I might be doing wrong?