I am wanting to only show some content if the current page is a child of a specific parent. I have tried things like
if Child(home-page)
If Parent == home-page
But not having much luck
Could someone please point me in the right direction?
Thanks
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I am wanting to only show some content if the current page is a child of a specific parent. I have tried things like
if Child(home-page)
If Parent == home-page
But not having much luck
Could someone please point me in the right direction?
Thanks
If you're doing this in the Template you have to wrap your if statement in a Parent Control
<% control Parent %>
<% if ClassName == HomePage %>
insert Content
<% end_if %>
<% end_control %>