Hi,
I need to check if a page (no matter what depth it is), is the descendant of a page with a certain template.
I have used isDescendantOf()
to check for a specific page before, but am not sure of the best way to check the template used through all ancestor pages.
Ultimately I need to grab a field value from the ancestor as well, to be used on its child. It needs to work something like this (psuedo code!):
<?php
if($page->isDescendantOf(/* Page with template foo */):
?>
// Grab the value of the themeColour field from that ancestor
<?php endif ?>
If anyone has any pointers that would be great