How to get top-level parent Pages?
-
I’m working on a larger site that has multiple “departments” and I need a sub-menu that is unique to each ‘department’. For example, I have two departments – Cars and Movies. I need every page that would belong in Cars (Ford, Nissan, Honda) to have a relevant menu, while pages belonging in Movies will list different pages.
The way I think I want to do this is to check the page to see if it has a parent. If so, the menu shown will be based on that parent (i.e, Cars or Movies). The problem is, I have no idea how to “crawl” all the way back to the highest level parent (and knowing this will be useful in creating breadcrumbs later on).
What is the best way to do this?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to get top-level parent Pages?’ is closed to new replies.