Magento CMS pages Meta Tags Control

Posted in: Magento- Oct 10, 2007 Comments Off

app\code\core\Mage\Page\Block\Html\Head.php

public function toHtml()
{
//Start Edit
$_cmsTitle Mage::getSingleton('cms/page')->getTitle();
if (
strlen($_cmsTitle)>0){
$this
->addText('<title>'.$_cmsTitle.'</title>'."\n\t");
}else{
$this
->addText('<title>'.$this->getTitle().'</title>'."\n\t");
}
//End Edit
$this->addText('<meta http-equiv="Content-Type" content="'.$this->getContentType().'"/>'."\n\t");
$this->addText('<meta name="description" content="'.$this->getDescription().'"/>'."\n\t");
$this->addText('<meta name="keywords" content="'.$this->getKeywords().'"/>'."\n\t");
$this->addText('<meta name="robots" content="'.$this->getRobots().'"/>'."\n");
$this->addText($this->getAdditionalCssJs());
$this->addText($this->getChildHtml());

return parent::toHtml();
}

Comments are closed.