I'm trying to figure out how to determine if a page is the first child of its parent and I can't seem to get it.
I have the parent page set up to redirect to the first child. The using portal page inheritance, I'm using the parent page as a template to set the look and feel for all of its children. I'd like to be able to display the name of the current page using a macro that was placed on the parent page; however, if the current page is the first child of the parent, I'd like that macro to show the title of the parent page.
My page structure looks something like this:
> Academic Programs (redirects to first child)
>> Overview <<show parent title>>
>> Undergraduate Programs <<show own title >>
>> Graduate Programs <<show own title >>
I couldn't find a way to determine of the current page is the first child, so I changed the parent's "Inactive menu item redirect to URL" to the overview page path and used this macro code to write out the page title:
{% (CurrentDocument.NodeAliasPath == CurrentDocument.Parent.DocumentMenuRedirectUrl) ? CurrentDocument.Parent.GetValue("DocumentName") : CurrentDocument.GetValue("DocumentName") #%}
Looking at the values in "CurrentDocument.NodeAliasPath" and "CurrentDocument.Parent.DocumentMenuRedirectUrl" I think this should work properly, but must be missing something.
I'm sure this is a complete newbie question, but can someone help me out?
Thanks,
Sean