How to get Magento category page title in frontend? Already tried:
<?php if ($category->getPageTitle()):?>
<?php echo $_helper->categoryAttribute($_category, $_category->getPageTitle(), 'page_title') ?>
<?php else: ?>
How to get Magento category page title in frontend? Already tried:
<?php if ($category->getPageTitle()):?>
<?php echo $_helper->categoryAttribute($_category, $_category->getPageTitle(), 'page_title') ?>
<?php else: ?>
I think, you have a typo here (if you have created page_title
attribute) :
Replace <?php if ($category->getPageTitle()):?>
WITH <?php if ($_category->getPageTitle()):?>
If you want to get meta_title
(this is shown as Page Title
in category edit page at admin)
then use :
<?php if ($_category->getMetaTitle()):?>
<?php echo $_helper->categoryAttribute($_category, $_category->getMetaTitle(), 'meta_title') ?>
<?php else: ?>
You need to rewrite Mage_Catalog_CategoryController
add below code in viewAction
after $this->loadLayoutUpdates();
code
<?php if ($category->getMetaTitle()):?>
<?php $this->getLayout()->getBlock('head')->setTitle($this->__($category->getMetaTitle())); ?>
<?php else: ?>