Help with getting page name

Permalink
I have a custom page type that should show the page name as a header to the body of the page. But, it is not doing so,below is the code from the page type.php. The part NEED FIXED, shows up in the page, instead of the page name. This does not happen in the core C5 page type,just this theme page type. Any help will be appreciated.

Code Begin
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header.php');
?>

<div id="header">
<div class="content-med mast-head clearfix">
<h1>NEED FIXED</h1>
<div class="breadcrumb">
<?php
$content = new Area('Breadcrumb');
$content->display($c);
?>
<?php /*
<ul>
<li class="first active"><a href="#">ABOUT US</a></li>
<li><a href="#">OUR MISSION</a></li>
<li><a href="#">OUR TEAM</a></li>
<li><a href="#">GALLERY</a></li>
</ul>
*/?>
</div>
<div class="clear"></div>
</div>
</div>

Code End

 
ronyDdeveloper replied on at Permalink Best Answer Reply
ronyDdeveloper
Here is the code:
<?php $parentPage = Page::getByID($c->getCollectionParentID()); ?>
<?php  if ($c->getCollectionTypeHandle() == 'blog_entry' || $c->getCollectionTypeHandle() == 'pb_post') { ?>
<h1><?php  echo $parentPage->getCollectionName();?></h1>
<?php  } else {?>
<h1><?php  echo $c->getCollectionName() ?></h1>
<?php  } ?>


Rony
SignallHill replied on at Permalink Reply
Thanks a bunch. Worked Great