Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add something to right sidebar in Magento

I'm new to Magento. I've read a dozen of questions here and posts on Magento forums but none of them seem to explain how to solve my problem.

I have a two column layout for my category pages. In right column I have "Recently viewed items", "My basket" and "Compare products". All I need to do is add a static block to the right column.

As far as I know I have to edit some xml file but where is that file? I can't seem to even find how those three existing block were added. My guess is if I could find those I'd figure out how to add one more.

Please help, I'm completely lost now. Thanks.

Edit

I'm obviously missing something fundamental here. Let me put it in other words.
I have a category "AAA" In this category I have added using Admin panel: a description, image and assigned few products. Then I open this category in web browser I see all my data in main area and those three blocks (mentioned above) in right sidebar.
How does Magento know to show those particular three blocks and not some others? Where does it say to show those three blocks?

like image 650
6bytes Avatar asked Apr 04 '11 14:04

6bytes


1 Answers

You need to update a layout XML file located in app/design/frontend/*DEFAULT*/*DEFAULT*/layout/. Which XML file depends on exactly where you will be updating.

If you want this static block to show up on every single you will need to update the default handle in page.xml. Or, even better, create your own local.xml file as described here, and put this in the contents.

<layout version="0.1.0">
  <default>
    <reference name="right">
      <block type="your/type" template="path/to/your/template.phtml" />
    </reference>
  </default>
</layout>

If you still have questions, I recommend you review the Designer's Guide

like image 159
shaune Avatar answered Sep 28 '22 09:09

shaune