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

Error including CMS static block in PHTML
 
infield
Sr. Member
 
Total Posts:  89
Joined:  2007-11-04
San Francisco
 

I want to include content from a Static block in my template. I am able to get the front end to render the CMS static block but I am getting the error

Fatal errorCall to a member function getPageContent() on a non-object in /home/staging/public_html/app/design/frontend/default/coolsets/template/cms/content.phtml on line 22

I defined a static block with the identifier nav_bottom

in page.xml I have added the new block above the footer block in the default template

<block type="page/html/navBottom" name="navBottom" as="navBottom" template="page/html/navBottom.phtml">
                <
block type="cms/block" name="nav_bottom">
                       <
action method="setBlockId"><block_id>nav_bottom</block_id></action>
                </
block>
            </
block>


            <
block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
                <
block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
                <
block type="page/template_links" name="footer_links" as="footer_links" template="cms/content.phtml"/>
            </
block>

in templatepage/html/navBottom.phtml

<?php echo $this->getChildHtml() ?>

The page renders fine intill it gets to the footer.phtml block then gives an error.

I’m sure I’m missing something pretty basic, but I’m stumped. Any tips would be appreciated.

-marc

 
Magento Community Magento Community
Magento Community
Magento Community
 
infield
Sr. Member
 
Total Posts:  89
Joined:  2007-11-04
San Francisco
 

Just an update. Turns out the error was not from the block I was asking about. Once I rolled back to a working version of the page.XML I pasted in the navBottom block and it worked fine.

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