Magento: how to add static block AFTER product listing

On the website, my boss wants me to insert a static block AFTER the list of products in that category. So far, using Front End Magento app you can see here , I saw that I can add a static block just before the product list. How do I put a block after the list of products for each category? For example this is a site page I'm working on and I would like to display a block at the bottom of the page after the product but before the footer links. I think I have to change some files (like page.xml or local.xml) ma I don't know how and I didn't find anything useful on the net. You can help?

+3


source to share


1 answer


In local.xml add the following, replacing cms_extra with your CMS block id.

 <!-- Catalog Category (Anchor) -->
 <catalog_category_layered>
     <reference name="content">
         <block type="cms/block" name="cms_extra" after="category.products">
             <action method="setBlockId"><block_id>cms_extra</block_id></action>
         </block>       
     </reference>
 </catalog_category_layered>

 <!-- Catalog Category (Non-Anchor) -->
 <catalog_category_default>
     <reference name="content">
         <block type="cms/block" name="cms_extra" after="category.products">
             <action method="setBlockId"><block_id>cms_extra</block_id></action>
         </block>
     </reference>
 </catalog_category_default>

      

Alternatively, if there should be a different CMS block for each category, add the following at the bottom of your /product/list.phtml directory ..



 <?php
     $catcode = Mage::registry('current_category')->getId();
     echo $this->getLayout()->createBlock('cms/block')->setBlockId('category_block_' . $catcode .'')->toHtml(); 
 ?>

      

Create CMS block of each category with category_block_categoryid

+5


source







All Articles