Magento

eCommerce Software for Online Growth

Magento Forum

From setting up your store to managing your products, pages and promotions to generating detailed reports, the Magento User Guide empowers the user to utilize the platform for all of its vast capacity.
Available in eBook and Print formats – Download Now!!!
   
Can not get Static Block to display on CMS home page. 
 
aguay
Jr. Member
 
Total Posts:  6
Joined:  2008-08-27
 

Hi.

I’ve read through all the forum posts on this, and I still can’t get it to work.

I have a one column home page, and I want to display an image under the header and above the footer.

I’ve tried a few different codings in the static block to call the image, and I’ve the put references to the block in different places… the “custom design” tab, the “page content” box, in phtml files, in xml files…

Can someone help me through this?

I have a static block “home_splash” that just needs to contain one image, in the images folder under skin. How exactly do I call the image in the static block, and where exactly do I put the reference to the block? One place, two places?

Thanks so much! Most things I’ve been able to figure out as I’ve gone along here, but I’ve seen so many different answers for this sort of problem that I think I’ve gotten myself confused.

-Andrew

 
Magento Community Magento Community
Magento Community
Magento Community
 
AnnaM
Guru
 
Avatar
Total Posts:  325
Joined:  2008-01-29
San Francisco
 

If I follow you, I will state first something you probably know, but to make sure
CMS...Manage Pages (NOT Static Blocks) click on Home Page
There you will find the big white block

Put all the html, js, flash etc you want in theer.  For images, with sites that use rewrite, I alwasy use the full url to the img, ie
<img src="http://www.domain.com/skin/frontend/default/default/images/image.jpg" width="nnn" height="nnn">

using relative doesn’t generally work as the page is assembeled on the fly from the db I guess,so if you put
<img src="/skin/frontend/default/default/images.image.jpg" width="nnn" height="nnn">
I find it generally doens’t work.  I always use full urls and it seems to work. 

I had a similar problem with the skin for a Flash Video, no matter where I put it, the block/page showed the flash, but not the skin.  Finally in the flash project I specified the FULL url to where the skin resides and it worked fine.

 Signature 

Anna
Live Long and Prosper

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

You can reference your static block in XML in this manner:

<block type="cms/block" name="cms_test_block">
       <
action method="setBlockId"><block_id>test_block</block_id></action>
</
block>

This works if you name your static block “test_block”

You can add this in your “layout update xml” area (wrap it in something like <reference name="root"> )

 Signature 

@ My Magento Blog

- Handy tutorials on programming and designing Magento. A continual work in progress!
- Now with a new design, new hosting and a new domain! Check it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
aguay
Jr. Member
 
Total Posts:  6
Joined:  2008-08-27
 
AnnaM - 01 October 2008 01:09 PM

If I follow you, I will state first something you probably know, but to make sure

Thank you so much! This is something I was somehow missing, but it works perfectly now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
AnnaM
Guru
 
Avatar
Total Posts:  325
Joined:  2008-01-29
San Francisco
 

your welcom, glad to help out.

 Signature 

Anna
Live Long and Prosper

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 
AnnaM - 01 October 2008 01:09 PM

If I follow you, I will state first something you probably know, but to make sure
CMS...Manage Pages (NOT Static Blocks) click on Home Page
There you will find the big white block

Put all the html, js, flash etc you want in theer.  For images, with sites that use rewrite, I alwasy use the full url to the img, ie
<img src="http://www.domain.com/skin/frontend/default/default/images/image.jpg" width="nnn" height="nnn">

using relative doesn’t generally work as the page is assembeled on the fly from the db I guess,so if you put
<img src="/skin/frontend/default/default/images.image.jpg" width="nnn" height="nnn">
I find it generally doens’t work.  I always use full urls and it seems to work. 

I had a similar problem with the skin for a Flash Video, no matter where I put it, the block/page showed the flash, but not the skin.  Finally in the flash project I specified the FULL url to where the skin resides and it worked fine.

You can use a special notation to get your URL’s in the static block / cms area:

//in place of this:
<img src="http://www.domain.com/skin/frontend/default/default/images/image.jpg" width="nnn"  height="nnn" />

//use this:
<img src="{{skin url=images/media/image.jpg}}" alt="" width="nnn"  height="nnn"  />
{{base_url}} also works to output your base URL (http://www.mysite.com)

 Signature 

@ My Magento Blog

- Handy tutorials on programming and designing Magento. A continual work in progress!
- Now with a new design, new hosting and a new domain! Check it out!

 
Magento Community Magento Community
Magento Community
Magento Community
 
AnnaM
Guru
 
Avatar
Total Posts:  325
Joined:  2008-01-29
San Francisco
 
nikefido - 02 October 2008 10:25 AM

AnnaM - 01 October 2008 01:09 PM
If I follow you, I will state first something you probably know, but to make sure
CMS...Manage Pages (NOT Static Blocks) click on Home Page
There you will find the big white block

Put all the html, js, flash etc you want in theer.  For images, with sites that use rewrite, I alwasy use the full url to the img, ie
<img src="http://www.domain.com/skin/frontend/default/default/images/image.jpg" width="nnn" height="nnn">

using relative doesn’t generally work as the page is assembeled on the fly from the db I guess,so if you put
<img src="/skin/frontend/default/default/images.image.jpg" width="nnn" height="nnn">
I find it generally doens’t work.  I always use full urls and it seems to work. 

I had a similar problem with the skin for a Flash Video, no matter where I put it, the block/page showed the flash, but not the skin.  Finally in the flash project I specified the FULL url to where the skin resides and it worked fine.

You can use a special notation to get your URL’s in the static block / cms area:

//in place of this:
<img src="http://www.domain.com/skin/frontend/default/default/images/image.jpg" width="nnn"  height="nnn" />

//use this:
<img src="{{skin url=images/media/image.jpg}}" alt="" width="nnn"  height="nnn"  />
{{base_url}} also works to output your base URL (http://www.mysite.com)

Interesting, thanks thats good to know. Does that =sign really belong there though
“{{skin url=images
rather than
“{{skin url/images
???
also seems like if there are two open curlys there should be two closed curlys?  Not sure I totally follow, but with a little experimentation it can probably save some typing, which is always welcome.

I will experiment with that. Hadn’t thought of it, could make life a bit easier! Thanks.

 Signature 

Anna
Live Long and Prosper

 
Magento Community Magento Community
Magento Community
Magento Community
 
menachem
Jr. Member
 
Total Posts:  2
Joined:  2008-09-25
 
nikefido - 02 October 2008 10:25 AM

AnnaM - 01 October 2008 01:09 PM
If I follow you, I will state first something you probably know, but to make sure
CMS...Manage Pages (NOT Static Blocks) click on Home Page
There you will find the big white block

Put all the html, js, flash etc you want in theer.  For images, with sites that use rewrite, I alwasy use the full url to the img, ie
<img src="http://www.domain.com/skin/frontend/default/default/images/image.jpg" width="nnn" height="nnn">

using relative doesn’t generally work as the page is assembeled on the fly from the db I guess,so if you put
<img src="/skin/frontend/default/default/images.image.jpg" width="nnn" height="nnn">
I find it generally doens’t work.  I always use full urls and it seems to work. 

I had a similar problem with the skin for a Flash Video, no matter where I put it, the block/page showed the flash, but not the skin.  Finally in the flash project I specified the FULL url to where the skin resides and it worked fine.

You can use a special notation to get your URL’s in the static block / cms area:

//in place of this:
<img src="http://www.domain.com/skin/frontend/default/default/images/image.jpg" width="nnn"  height="nnn" />

//use this:
<img src="{{skin url=images/media/image.jpg}}" alt="" width="nnn"  height="nnn"  />
{{base_url}} also works to output your base URL (http://www.mysite.com)

Just to confirm, the way nikefido suggested works.

 
Magento Community Magento Community
Magento Community
Magento Community
 
revelnick
Jr. Member
 
Total Posts:  9
Joined:  2008-09-02
 

the {{base_url}} that is getting quoted through all the posts really didn’t work for me in static blocks in 1.1.6

i tried {{base_url}}, {{base_url=}} etc.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Frederik Krautwald
Member
 
Avatar
Total Posts:  54
Joined:  2007-09-25
Reykjavík, Iceland
 

{{base_url}} in CMS does NOT work!!! (V. 1.1.6)

 Signature 

Icelandic Web Design and Web hosting

 
Magento Community Magento Community
Magento Community
Magento Community
 
brydave
Jr. Member
 
Total Posts:  10
Joined:  2008-12-10
 

Hi everyone,

I am also looking to have an image between the header and footer in a single column layout on my homepage, but for some reason my image will not display. When i preview the page it cannot find the link.  I’ve been referring to this thread and the designers guide but I must be overlooking something. I am also using a local testing server if that has anything to do with it…

Any ideas/help would be greatly appreciated…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2010 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
275571 users|1260 users currently online|346207 forum posts