I have a site I’m working on where the title of a parent document will be the main title on all the sub document pages. For example:
About Us
- Our History
- Locations
- Staff
So the Staff page would be something like this:
<h1>About Us</h1>
<h2>Staff</h2>
<p>whatever</p>
Whereas the parent of About Us page would be:
<h1>About Us</h1>
<p>whatever</p>
I would prefer to use the same Template for both but I can’t figure out how to make the <h2> conditional.
To grab the parent [*longtitle*] I’m using Get Field:
<h1>[!GetField? &parent=`1`&field=`longtitle`!]</h1>
And I can use menutitle or longtitle on the child documents in the <h2> but need the <h2> to not be rendered when on the parent document.
I’ve tried PHx but to no avail:
[+phx:if=`[*menutitle*]`:isnot=`[!GetField? &parent=`1`&field=`longtitle`!]`:then=`<h4>[*menutitle*]</h4>`+]
Tried it with an else as well that was empty. No luck.