title: Magento - Move Toolbar to Left block
body: <p>I am having problems moving Product List toolbar from content block to left block.</p>
  
  <p>I would like to display only sort-by option, which is easily done by setting up a custom toolbar template file toolbar_custom.html. But I get an error by output.</p>
  
  <p>So far I added this lines in <code>layout/catalog.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;catalog_category_default translate="label"&gt;
      &lt;label&gt;Catalog Category (Non-Anchor)&lt;/label&gt;
      &lt;reference name="left"&gt;
          &lt;block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"&gt;
          &lt;block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar_custom.phtml"/&gt;
          &lt;action method="setToolbarBlockName"&gt;&lt;name&gt;product_list_toolbar&lt;/name&gt;&lt;/action&gt;
      &lt;/block&gt;
      &lt;/reference&gt;
      &lt;reference name="content"&gt;
          &lt;block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml"&gt;
              &lt;block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"/&gt;
          &lt;/block&gt;
      &lt;/reference&gt;
  &lt;/catalog_category_default&gt;
  </code></pre>
  
  <hr>
  
  <p>and this in <code>navigation/left.phtml</code>:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php $magento_block = Mage::getSingleton('core/layout'); ?&gt;
  &lt;?php $toolbarHtml = $magento_block-&gt;createBlock('catalog/product_list'); ?&gt;
  &lt;?php $toolbarHtml-&gt;setTemplate('catalog/product/list/toolbar_custom.phtml'); ?&gt;
  &lt;?php echo $toolbarHtml -&gt;toHTML(); ?&gt;
  </code></pre>
  
  <hr>
  
  <p>This is my custom toolbar template - <code>toolbar_custom.phtml</code>:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php if($this-&gt;getCollection()-&gt;getSize()): ?&gt;
      &lt;div class="toolbar"&gt;
      &lt;?php if( $this-&gt;isExpanded() ): ?&gt;
          &lt;div class="sort-by"&gt;
              &lt;label&gt;&lt;?php echo $this-&gt;__('Sort By') ?&gt;&lt;/label&gt;
              &lt;select onchange="setLocation(this.value)"&gt;
                  &lt;?php var_dump($this-&gt;getName()); ?&gt;
                  &lt;?php foreach($this-&gt;getAvailableOrders() as $_key=&gt;$_order): ?&gt;
                      &lt;option value="&lt;?php echo $this-&gt;getOrderUrl($_key, 'asc') ?&gt;"&lt;?php if($this-&gt;isOrderCurrent($_key)): ?&gt; selected="selected"&lt;?php endif; ?&gt;&gt;
                          &lt;?php echo $this-&gt;__($_order) ?&gt;
                      &lt;/option&gt;
                  &lt;?php endforeach; ?&gt;
              &lt;/select&gt;
         &lt;/div&gt;
      &lt;?php endif; ?&gt;
      &lt;/div&gt;
  &lt;?php endif ?&gt;
  </code></pre>
  
  <hr>
  
  <p>As I open the product listing page in browser I get this error message: </p>
  
  <blockquote>
    <p>Fatal error: Call to a member function getSize() on a non-object in
    magento/app/design/frontend/my_theme/default/template/catalog/product/list/toolbar_custom.phtml
    on line 37</p>
  </blockquote>
  
  <p>I am using Magento Community 1.6..</p>