I have a ‘resume’ page with three different subpage types (‘skill’, ‘role’, and ‘education’). These subpages are never used directly—so they don’t have templates of their own, they are only used to build the parts of the ‘resume’ page. I’m trying to use the intendedTemplate() function to identify each of the subpage types, but it never seems to work. This is the relevant code in the ‘resume.php’ template file:
This unfortunately doesn’t result in any children being used. It’s not generating any PHP errors, it just doesn’t trigger. If someone could explain intendedTemplate a little or point out what’s wrong with the above code, I’d really appreciate the help.
You’re calling intendedTemplate on a collection of pages. That’s not going to work.
You need to filter your subpage collection by intended template instead of using the if.