Magento Forum

   
How i put a CMS static block in left/right columns
 
IgNoCh
Jr. Member
 
Total Posts:  3
Joined:  2008-09-26
 

I everyone..
im new in magento i would like to do a few modifications in my pages, but i don’t know how…
i like to know how do to put a cms static block (with html) in a left column o right column, using a xml layout update, because i like the change the contents for every page. And disable all defaults blocks in all pages and let only the cms blocks..

how i do it??

 
Magento Community Magento Community
Magento Community
Magento Community
 
eklusman
Jr. Member
 
Avatar
Total Posts:  25
Joined:  2008-10-09
 

What I did to add a static block is to put this code:

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

where I wanted the block to be displayed, this was in the main content from the home, but I guess you can add it to a column too.
Replace “xxxxx” with the id of the static block you created before.

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

Need a little help with this.

I used this method to put a CMS in the left column.
it positioned the cms OK, but it didn’t apply the default formatting for the left hand column, ie back colour etc.

Really struggling with how to make this apply the default formatting.

Long term I also want to put the mostviewedmodule in the left.

any help appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

Is it not just a CSS problem? Just set to inherit if that is not the default?

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

Yes, it very well could be, but I’m very new to this.

How do I set this to inherit the css style?

Thanks for you help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 
goldfish22 - 10 February 2009 03:51 PM

Yes, it very well could be, but I’m very new to this.

How do I set this to inherit the css style?

Thanks for you help.

I haven’t gotten that far myself! I would need to look at the HMTL and try to figure out if there were any surprises in the structure, find the location of the CSS file, and then open it over FTP in CSSEdit and start experimenting with changes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
goldfish22
Jr. Member
 
Total Posts:  26
Joined:  2009-02-05
 

Thanks, I played and figured it out.

Went through the CCs and added the DIV class in the CMS block.

Wasn’t to bad, I just thought there may have been a way of making this automatic.  eg, CMS placed in left automatically inherates the CCS of the left.
an example below.

<div class="block">    
       <
div class="block-top">&nbsp;</div>
             <
div class="block-content ">
                 
CQFIS a leading supplier of Industrial Supplies<br><br>
             </
div>
      <
div class="block-bottom"></div>
</
div>

havent started on the mostviewed module in the left yet, but that is next.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lynnspain
Member
 
Avatar
Total Posts:  65
Joined:  2008-08-07
Baleares, Spain
 

I am sorry I am being really thick with this. 

I want to ad a static block to the right column. I have created the static block so what do I do know. after spending the best part of a day looking at this forum and magento design docs I am told place this code in the right column. errr where do I find the correct html for the right column in which i should place this code?  Please help I am feeling less clever by the minute here.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Template fans
Guru
 
Total Posts:  446
Joined:  2009-11-02
 

Can anyone resolve this issue?

 
Magento Community Magento Community
Magento Community
Magento Community
 
designer84
Sr. Member
 
Total Posts:  102
Joined:  2009-08-20
 

Just to clarify and sum up this solution for version 4.0.1....

Add the code in the file Catalog.xml located here: app/design/frontend/base/default/layout (or YOUR relevant location) - Make sure to backup your original files before modifying!

Find the <reference name="left"> code and insert

<block type="cms/block" name="NAME.FOR.YOUR.BLOCK">
            <
action method="setBlockId"><block_id>YOUR-BLOCK-IDENTIFIER</block_id></action>
</
block>

Example:

<reference name="left">
            <
block type="cms/block" name="left.cms.nav">
            <
action method="setBlockId"><block_id>side_nav</block_id></action>
            </
block>
</
reference>

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