Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get page title in magento?

Any way to get the page title in magento...I Have a script live person..on this I need the current page title ..So can anybodey tell me how i get the current page title?

like image 945
Rahul Singla Avatar asked Feb 19 '13 05:02

Rahul Singla


2 Answers

use this code

$this->getLayout()->getBlock('head')->getTitle();

you can use this code in your phtml file

like image 176
Mufaddal Avatar answered Nov 10 '22 16:11

Mufaddal


To get the title without the Prefix (site name):

<?php echo str_replace(Mage::getStoreConfig('design/head/title_prefix'), '', $this->getLayout()->getBlock('head')->getTitle()); ?>
like image 42
Kevin Sadler Avatar answered Nov 10 '22 16:11

Kevin Sadler