Skip to content

Instantly share code, notes, and snippets.

@viezel
Last active December 20, 2015 08:19
Show Gist options
  • Save viezel/6100220 to your computer and use it in GitHub Desktop.
Save viezel/6100220 to your computer and use it in GitHub Desktop.
Magento - How to move Toolbar to the left/right column
<catalog_category_layered translate="label">
<reference name="left">
<!-- Adds the toolbar to the left column -->
<block type="catalog/category_view" name="category.page.toolbar" template="catalog/category/sidetoolbar.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml" />
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
</block>
<!-- We use the original toolbar - you could also write your own -->
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
</reference>
</catalog_category_layered>
<?php
// lets get the toolbar block
$toolbar = $this->getChild('product_list')->getToolbarBlock();
// add the product collection
$toolbar->setCollection($this->getChild('product_list')->getLoadedProductCollection());
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment