Magento Forum

   
How do I include a CMS page inside another one? 
 
mayerwin
Sr. Member
 
Avatar
Total Posts:  182
Joined:  2008-01-15
France
 

I have a simple question I couldn’t find any answer in the forum: how do I include a CMS page inside another one?

I firstly thought it would be as simple as writing :

{{block type="cms/page" block_id="[the CMS page URL identifier]" template="cms/content.phtml"}}

But since this doesn’t work at all, I greatly need your help. Maybe it’s just the “type” attribute that is not good, but I couldn’t find it since it is not documented.

Thank you for your help.

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

in Mage_Cms_Block_Page replace getPage() method with this one:

public function getPage()
    
{
        
if (!$this->hasData('page')) {
            
if ($this->getPageId()) {
                $page 
Mage::getModel('cms/page')
                    ->
setStoreId(Mage::app()->getStore()->getId())
                    ->
load($this->getPageId(), 'identifier');
            
else {
                $page 
Mage::getSingleton('cms/page');
            
}
            $this
->setData('page'$page);
        
}
        
return $this->getData('page');
    
}

Use as:

{{block type="cms/page" page_id="{cms page identifier}"}}

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