Can't seem to get it to show up.

This is how it's defined in layout files:

<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>

it's located here:


I'm attempting to add it to the CMS page via the Layout Update XML (Layout is 2 columns with left bar) section in the backend using:

<reference name="content">
    <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"></block>

I've also tried:

<reference name="content">
    <block type="enterprise_search/catalog_layer_view" name="catalog.content" before="-" template="catalog/layer/view.phtml">

The former shows nothing at all and the latter shows a single category dropdown that redirects to that specific category page.

Also, the product collection on the CMS page is being loaded by a widget. Would this have some effect? In the CMS page Content section is found:

{{widget type="catalog/product_widget_new" display_type="new_products" show_pager="1" products_count="60" template="catalog/product/widget/new/content/new_grid.phtml"}}

The above widget calls a function called _getProductCollection() in order to generate the product Collection of new products:

protected function _getProductCollection()
    $todayStartOfDayDate = Mage::app()->getLocale()->date()
    $todayEndOfDayDate = Mage::app()->getLocale()->date()
    /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
    $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
        ->addAttributeToFilter('news_from_date', array('or' => array(
            0 => array('date' => true, 'to' => $todayEndOfDayDate),
            1 => array('is' => new Zend_Db_Expr('null')))
        ), 'left')
        ->addAttributeToFilter('news_to_date', array('or' => array(
            0 => array('date' => true, 'from' => $todayStartOfDayDate),
            1 => array('is' => new Zend_Db_Expr('null')))
        ), 'left')
                array('attribute' => 'news_from_date', 'is' => new Zend_Db_Expr('not null')),
                array('attribute' => 'news_to_date', 'is' => new Zend_Db_Expr('not null'))
    return $collection;
  • Can you give us more information about what you are trying to do? Feb 3, 2015 at 16:05
  • @MayersDev does that help? Feb 3, 2015 at 16:08

1 Answer 1


Layered navigation needs an active category to be able to work. If I remember correctly this should do it.

<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml">
   <action method="setCategoryId"><category_id>[category ID]</category_id></action>

As a side note, there is a free module that gives you pages with products and a layered navigation and some content fields like CMS pages.



To have a category with new products create a custom module that runs a cron every night that assigns the products to the new category. Below will add all products added after last week.

    public function assignToNew()
        $collection = Mage::getResourceModel('catalog/product_collection')
        $collection->addAttributeToFilter('updated_at', array('gteq' => date('Y-m-d', strtotime('-1 week')));
        $collection->addAttributeToFilter('status', 1);
        // whatever you need to filter

        $products = array_fill_keys($collection->getAllIds(), '1');

        $category = Mage::getModel('catalog/category')->load([id of the cat]);

  • Okay, but i'm generating a collection based upon which products in our catalog are 'new'. What would I assign as the category_id in this case? Feb 13, 2015 at 15:07
  • and you want to be able to filter those based on attributes? Feb 13, 2015 at 15:08
  • Yes. I'll attach the _getProductCollection function that is used in the widget as well. Feb 13, 2015 at 15:12
  • Ahh ok. I've done this before. The easiest way is to create a category, 'new', for example and run a cron every night that assigns the products to this category. Let me look if I can find the code Feb 13, 2015 at 15:16
  • 1
    Hm I'm not sure it's even possible to load the filtered values on a cms page since it works with GET variables. You might be able to rewrite all the layered navigation links to post to this CMS page but that would be a major core hack Feb 13, 2015 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.