relevance: (ver. 0.8.16100)
this should get metakeywords and metadescriptions working when you’re viewing a category.
open the following:
app/code/core/Mage/Catalog/Block/Category/View.php
replace the protected function _prepareLayout() with this:
protected function _prepareLayout () { parent :: _prepareLayout (); $this -> getLayout ()-> createBlock ( 'catalog/breadcrumbs' ); if ( $headBlock = $this -> getLayout ()-> getBlock ( 'head' )) { if ( $title = $this -> getCurrentCategory ()-> getMetaTitle ()) { $headBlock -> setTitle ( $title . ' ' . Mage :: getStoreConfig ( 'catalog/seo/title_separator' ). ' ' . Mage :: getStoreConfig ( 'system/store/name' )); } /* elseif ($headBlock = $this->getLayout()->getBlock('head')) { $headBlock->setTitle($this->getCurrentCategory()->getName()); } */ // start iblastoff metakeyword & metadescription fix if ( $keyword = $this -> getCurrentCategory ()-> getMetaKeyword ()) { $headBlock -> setKeywords ( $keyword ); } elseif( $currentCategory = Mage :: registry ( 'current_category' ) ) { $headBlock -> setKeywords ( $currentCategory -> meta_keywords ); } if ( $description = $this -> getCurrentCategory ()-> getMetaDescription ()) { $headBlock -> setDescription ( ( $description ) ); } else { $headBlock -> setDescription ( $this -> getCurrentCategory ()-> getDescription () ); } // end iblastoff metakeyword & metadescription fix } if ( $layout = $this -> getCurrentCategory ()-> getPageLayout ()) { $template = (string) Mage :: getConfig ()-> getNode ( 'global/cms/layouts/' . $layout . '/template' ); $this -> getLayout ()-> getBlock ( 'root' )-> setTemplate ( $template ); } return $this ; }
Signature
stevelam.ca | xpattern.net