5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 389 Views |
-
[solved] Find out whether a page has a certain page / grandparent.

7 April 2011 at 4:30am
Hi,
I'm looking to show a different header and footer in my templates depending on whether the current page has a certain ancestor.
So if the url has
www.mysite.com/us/mycategory/mypage perform one action
else
if the url haswww.mysite.com/nz/mycategory/mysubcategory/mypage perform another action.
I want to show one header and footer for us and another for nz. The page could be a variable number of levels down the heirarchy. Is there anything in SilverStripe to do this?
Thanks,
Nick
-
Re: [solved] Find out whether a page has a certain page / grandparent.

7 April 2011 at 4:56am
Solved:
<% if InSection(nz) %>
<p>God Bless NZ!</p>
<% end_if %>
| 389 Views | ||
|
Page:
1
|
Go to Top |

