Try the Demo

Magento Forum

   
CMS Pages & SEO
 
Dan Orsborne
Member
 
Total Posts:  72
Joined:  2007-09-20
 

The page titles from the CMS Pages don’t get put on the actual pages when you view them. This can be fixed by changing the following:
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();
    
}

 Signature 

http://www.igentics.com

Igentics are Internet Engineers, we like to look at things from a different angle. The end result being a fully integrated system encompassing the whole supply chain from supplier to end user, incorporating all legacy systems and data. This increases profits and reduces cost.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jmayer
Jr. Member
 
Total Posts:  21
Joined:  2007-09-03
 

Hi Dan,

This seems to throw an error on the 0.6.13700 build.
Any ideas here?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jsperri
Sr. Member
 
Total Posts:  126
Joined:  2007-08-31
Fistufle
 

jmayer, which error do you get ? Can you paste it here ?

This patch works fine for me (ver 0.6.13700), and actually fix the title problem for CMS pages.
I hope Varien can include the patch in future release.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@jsperry: we’ll fix it a bit differently, so there won’t be dependency of Mage_Page from Mage_Cms.
In Mage_Cms_Helper_Page::renderPage will be added head title update:

// add this
        if ($head $action->getLayout()->getBlock('head')) {
            $head
->setTitle($page->getTitle());
        
}
// before
        
$action->renderLayout();

Note that home page and page not found will also have titles of the CMS pages.

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top