Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
How do I include static block content in a template? 
 
infield
Member
 
Total Posts:  67
Joined:  2007-11-04
San Francisco
 

I have a block that I want to show content from CMS -> static blocks in the backend.

I have a block called navBottom which currently shows static content.
in page.xml

<block type="page/html/navBottom" name="navBottom" as="navBottom" template="page/html/navBottom.phtml"/>

snippet from 2columns-right.phtml

!-- [start] bottom-menu -->
        <
div class="nav-bottom-container">

            
<?php echo $this->getChildHtml('navBottom'?>

        
</div>
        <!-- 
[end] bottom-menu -->

navBottom.phtml

<div class="navBottom">
BOTTOM NAV
</div>

I would like BOTTOM NAV to actually be the content defined in the static block with the identifier nav_bottom.

Can anyone offer any tips on how to go about this?

Thanks,
-marc

 
Magento Community Magento Community
Magento Community
Magento Community
 
timothyleetaylor
Sr. Member
 
Avatar
Total Posts:  160
Joined:  2008-02-05
New Zealand
 

Hi @infield,

If you were still looking as to how to do this, do the following:

-> go ahead and create the static block via the ADMIN

-> Use this code: <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('yourBlockName')->toHtml() ?>

Switch out “yourBlockName” with the static block name you just created.

It should work fine!

- Lee

 Signature 

Elias Interactive
Web Design & Development
http://www.eliasinteractive.com
Skype: leetaylor.elias

 
Magento Community Magento Community
Magento Community
Magento Community
 
andy101010
Jr. Member
 
Total Posts:  15
Joined:  2008-02-14
 

Thanks Lee!!!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
50099 users|436 users currently online|102231 forum posts