Child Page

Permalink
Hey guys,

Does anyone know of a good way to determine if the current page is a child or descendant of page x? For instance a function that would return true when the current page exists at /page-x/child or /page-x/another-page/descendant.

Benji
 
ScottC replied on at Permalink Reply
ScottC
navigation helper, getTrailToCollection($collectionObject)

fetches cIDs of cParentID until it hits one.

Where that even matters is you can array_intersect or simply a in_array of whatever value that is good for.

You could use the intersect to mark parentIDs in say a 5 deep autonav is being(active) or whatever to show you are under that page.

Hope that helps.