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

How to add some Static Block content above Contacts Form? 
 
Appmerce
Guru
 
Avatar
Total Posts:  376
Joined:  2008-05-13
Amsterdam, The Netherlands
 

Hi there,

I’ve created a Static Block with the clients address. Now I want to show that Static Block’s content in the /contacts page.

I added this to /template/contacts/form.phtml, just under the title <h4>:

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

And I added this to the contacts.xml in the <default> section:

<block type="cms/block" name="static.contact" as="staticContact">
            <
action method="setBlockId"><block_id>contactpage</block_id></action>
        </
block>

But it doesn’t output anything. I’m just missing out on the logic here. I really don’t understand. Can somebody help out?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

What’s the reason to go through all those steps? why not just add your static html code directly in the form.phtml ?

Preserver upgrade compatibility? I don’t see a sense of it because everything in the frontend folder is design’s realm, and I think it should stay that way, make it independent. When you upgrade Magento, all your phtml files shouldn’t be overwritten.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('contactpage')->toHtml() ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Appmerce
Guru
 
Avatar
Total Posts:  376
Joined:  2008-05-13
Amsterdam, The Netherlands
 
chinesedream - 18 July 2008 05:55 AM

What’s the reason to go through all those steps? why not just add your static html code directly in the form.phtml ?

Preserver upgrade compatibility? I don’t see a sense of it because everything in the frontend folder is design’s realm, and I think it should stay that way, make it independent. When you upgrade Magento, all your phtml files shouldn’t be overwritten.

That’s a weird reply! Of course it needs to be in the static block, so the client can EDIT it via the CMS…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Appmerce
Guru
 
Avatar
Total Posts:  376
Joined:  2008-05-13
Amsterdam, The Netherlands
 
Unirgy - 21 July 2008 05:43 AM

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('contactpage')->toHtml() ?>

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
x4hai
Jr. Member
 
Total Posts:  16
Joined:  2008-09-19
 

Try this: http://demo.hello-magento.com/freecms/furniture.html

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