Get Page Title (not covered in cheat sheet)
Permalink
Hi There
I am trying to make a statement to adapt my theme outside of autonav.
I need to say basically:
IF page level = below 1 THEN print parent title
ELSE print page title
However I cant work out how to say the print page title bit as the copy from the Cheat sheet deonst work in this context and I am not that shot at PHP.
So far I have the below - what should go where the XXX is. Any help greatly appreciated.
Thanks
I am trying to make a statement to adapt my theme outside of autonav.
I need to say basically:
IF page level = below 1 THEN print parent title
ELSE print page title
However I cant work out how to say the print page title bit as the copy from the Cheat sheet deonst work in this context and I am not that shot at PHP.
So far I have the below - what should go where the XXX is. Any help greatly appreciated.
Thanks
You assign the variable root to the current page with $root=Page::getCurrentPage(); Root now holds the page object, which you get information about the page from, so making a call to get the name of root calls the current name.