Page list template – title

Permalink
I'm trying to edit a page list template so that it has the title of the parent page printed at the top of the list...

So, if you have selected "beneath this page" or "beneath another page" then the list will display a title echoing the name of the parent page in question...

Presently I have made separate template for each different list i use this on, but it'd be nice to have a smart bit of php to do this with

THANKS

olay
View Replies: View Best Answer
clevyr replied on at Permalink Best Answer Reply
clevyr
Here is how we figured out how to do it. I hope this helps.

<?php 
      $parentID = $controller->cParentID;
      $page = Page::getbyID($parentID);
      $parentName = $page->getCollectionName();
?>   
<h3><?php echo $parentName; ?></h3>
plschneide replied on at Permalink Reply
plschneide
Thanks - funny I was just searching and figured this out a few minutes ago. Thanks though!!!
pixilated44 replied on at Permalink Reply
Thank you, this bit of code was extremely helpful.
olay replied on at Permalink Reply
olay
I just had a needed for this code – and when I searched the forums found my question (which I don't remember writing) from two years ago, but never knew it had been answered – many thanks, works perfectly.