Magento – How to change H1 title in categories

categorymagento-1.9page-title

I need to change the h1 title using Custom Layout Update field in the category edit view

How can I do this? Change many categories h1 titles without change the category name?

Best Answer

I assume you are using Magento 1.

This solution tested on Magento 1.9.2.3.

Here is what you can try:

1 - In category Custom Layout Update:

    <reference name="category.products">
      <action method="setAltName"><value>new h1 name</value></action>
    </reference>

2 - In this file below replace the code to add the H1 tag.

File: app/design/frontend/[yourPackage]/[yourTheme]/template/catalog/category/view.phtml

Content to change:

    <h1><?php if($this->getAltName()):?><?php echo $this->getAltName() ?><?php else: ?><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?><?php endif; ?></h1>

3 - Clear Magento cache.

This solution uses AltName for H1 and if it is not set it uses category name.