I want text in <h1> tag to match page title, but without store prefix.

I'm getting page title like so:

    <?php echo $this->getLayout()->getBlock('head')->getTitle(); ?></h1>

How can I get page title without store prefix, or how can I retrieve store prefix option?

Thank you!

2 Answers 2


The quick and dirty way to do it.

To cut prefix:

$prefix = Mage::getStoreConfig('design/head/title_prefix');
$title = $this->getLayout()->getBlock('head')->getTitle();
$processedTitle = trim(substr($title, strlen($prefix)));
<h1><?php echo $processedTitle;?></h1>

To cut suffix:

$suffix = Mage::getStoreConfig('design/head/title_suffix');
$title = $this->getLayout()->getBlock('head')->getTitle();
$processedTitle = substr($title, 0, strlen($suffix) * -1);
<h1><?php echo $processedTitle;?></h1>

Just access the _data-Array directly:

  • Returns the same result for me, with store title.
    – Marvin3
    May 23, 2013 at 16:07
  • 1
    yes, obviously. because the value of _data is changed. there is no way to get the original value back. May 23, 2013 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.