Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Custom CMS block implementation
 
tman_f
Sr. Member
 
Total Posts:  85
Joined:  2008-02-12
 

Hi all,

I have created a few CMS blocks, to name a few I have: mission_statement, latest_news, quick_links, etc…

I would like to include those blocks from a generic template, that has already been called by the skeleton template.

For instance, the skeleton template contains a block called “additional_info” which includes a template additional.phtml.

From that additional.phtml I would like to insert the cms block content. Obviously I could not create the individual blocks in the skeleton template that include the cms blocks, then call them via $this->getChildHtml(’id’), since the template is already a child of the skeleton template. So, how might I achieve this functionality?

Any Suggestions?

Thanks.

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

If you want to include from .phtml tempate CMS block, do it this way:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('additional_info')->toHtml() ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
tman_f
Sr. Member
 
Total Posts:  85
Joined:  2008-02-12
 

@Moshe:

Awesome, works great. You never let me down.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
angelkiss666
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2008-04-02
Lancaster, Pa USA
 

MOSHE YOUR AWESOME! AFTER A WEEK I FOUND THIS ANSWER..I HAVE BEEN RACKING MY BRAINS....TY TY TY TY for always supporting us!

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