Pulling Parent page title into the page template

Permalink
Hi

I have a site which has little sites under areas so

Area and then the child pages.

Is there a way to pull the name of the parent page into the page template automatically?

I tried the get collection code but that was showing the page name and not the parent page name.

Cheers, Matt

Matteld80
 
studio108 replied on at Permalink Reply
studio108
I think it's something like this.

<?php
$page=Page::getByID($c->getCollectionParentID());
echo $page->getCollectionName();
?>

There is a good cheat sheet resource here:http://www.weblicating.com/doku/doku.php?id=cheatsheet/#.U8e_6Y1dU_...

Regards
Luke
Matteld80 replied on at Permalink Reply
Matteld80
Awesome - the code for the parent page has worked from your cheat sheet. Thanks for that.

Do you know of a way to add a link back to the parent so href="/parent/contact-us"

Thanks Matt