Created
December 14, 2015 17:31
-
-
Save traviswaelbro/0ef032ddcd3e93b66944 to your computer and use it in GitHub Desktop.
Update to Magento /catalog/category/view.phtml template that allows admin to specify a different h1 in the description to override the default "category name" as h1. In our application, this allows us to use SEO-specific phrasing on the category page, while using more user-friendly names for the navigation menu, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="page-title category-title"> | |
<?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?> | |
<a href="<?php echo $this->getRssLink() ?>" class="link-rss"><?php echo $this->__('Subscribe to RSS Feed') ?></a> | |
<?php endif; ?> | |
<?php // Display normal category name as h1 unless there is an h1 set in the category description ?> | |
<?php if( $_description=$this->getCurrentCategory()->getDescription() ) { ?> | |
<?php if(strpos( $_helper->categoryAttribute($_category, $_description, 'description'), "h1" ) !== false) { ?> | |
<?php } else { ?> | |
<h1 class="test"><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h1> | |
<?php } ?> | |
<?php } else { ?> | |
<h1><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h1> | |
<?php } ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment