I have moved the layered navigation block into the content section however I can't figure out how to position the block. I can only get it to show at the very top of the page or the bottom. I need it before the product listing and after the toolbar. So far my xml looks like this:
<reference name="content">
<block type="catalog/layer_view" name="catalog.leftnav" before="product_list" after="product_list_toolbar" template="catalog/layer/view.phtml"/>
</reference>
But that doesn't seem to be working. Any suggestions?
Thanks
Best Answer
The reason your layered navigation only shows up at the bottom or at the top of the page is that you add the block at the wrong block "level".
You added the block to the block
content
which only has two direct child blocks:category.products
andproduct.tooltip
. Therefore you only can add your block at the top, between these two blocks or at the bottom.How to move the layered navigation between the product list toolbar and the product list
Add this code to your layout XML:
This will move the layered navigation block from the left column to the content column without re-creating classes and the like. You can see I inserted the block as a child of the block
product_list
.If you call the page now you will see that the layered navigation isn't displayed at all. That's because opposed to the
content
block, theproduct_list
block doesn't output all child blocks by default. You have to echo the block yourself in the template file.Copy
app/design/frontend/base/default/template/catalog/product/list.phtml
(replace base/default with your base theme if you use another one as your starting point) to your theme and tell Magento to output the layered navigation directly after the first toolbar:You will get something like this and can go on from here: