Reputation: 6132
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?
Upvotes: 10
Views: 51213
Reputation: 2520
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
Upvotes: 14
Reputation: 41
Those blocks are denoted to show in the catalog.xml file, checkout.xml file and the reports.xml file. Recently compared block will also appear if a customer performs a compare products, as would wishlist if a customer adds products to their wishlist (this block s controlled by wishlist.xml). If you wish to stop these blocks from appearing then simply edit these files removing the references referring to the right column and the relevant blocks.
It is possible to edit files so that blocks only appear in certain instances, see the following post for instructions http://emagen.co.uk/magento-tips-advice/hide-shopping-cart-sidebar/
Upvotes: 4