1

I've added a CMS page wich shows all the products listed under the "All Products" category by creating a CMS page with a "two column with left sidebar" layout, and in the content tabs, I've added the following code:

{{block type="catalog/product_list" category_id="2" template="catalog/product/list.phtml"}}

I was reading about it and the layered navigation should be showing already. However, I've set "Is anchor" to yes, but it doesn't work. I can't make it to appear. What am I missing here? Is there a better way to create this catalog page?

Thanks in advance.

Dênis Montone
  • 581
  • 2
  • 7
  • 18

4 Answers4

2

To display layered navigation on cms page you have to set root category to Is Anchor=Yes.

Manoj Chowrasiya
  • 970
  • 1
  • 13
  • 32
1

Please check the below link for calling layer navigation in CMS Page

http://www.webdesign-gm.co.uk/news/web-design/magento-web-design/layered-navigation-on-home-page-or-any-cms-page-magento.php

Or you can try this Design tab->Page Layout->Layout Update XML:

 <reference name="left">
        <!-- Layered Navigation Block -->
        <block type="catalog/layer_view" name="catalog.leftnav" template="catalog/layer/view.phtml" >
                <action method="setCategoryId"><category_id>40</category_id></action>
        </block>
</reference>

<reference name="content">
        <block type="catalog/product_list" name="home" template="catalog/product/list.phtml">

                <!-- Product List View -->
                <action method="setCategoryId"><category_id>40</category_id></action>
                <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>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>

        </block>
</reference> 
Amit Bera
  • 7,581
  • 7
  • 31
  • 57
  • I've tried this and it gives me "Fatal error: Call to a member function setLayer() on a non-object in /home/website/public_html/app/code/core/Mage/Catalog/Block/Layer/View.php on line 134". Any suggestions? – zekia Jun 11 '14 at 12:52
  • @AmitBera your link is broken. – easymoden00b Jan 14 '15 at 15:10
  • I've tried this and it gives me "Fatal error: Call to a member function setLayer() on a non-object in /home/website/public_html/app/code/core/Mage/Catalog/Block/Layer/View.php on line 134". Any suggestions? – Bhavesh Godhani Sep 18 '15 at 08:33
1

Open CMS->Pages->[your page] in Magento Admin Panel. Add the following layout instructions to Design tab->Page Layout->Layout Update XML

<block type="catalog/product_list" name="product_list" 

  template="catalog/product/list.phtml">

  <action method="setCategoryId"><category_id>3</category_id></action>

  <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>

  <action method="addColumnCountLayoutDepend">

      <layout>empty</layout>

      <count>6</count>

  </action>

  <action method="addColumnCountLayoutDepend">

      <layout>one_column</layout>

      <count>5</count>

  </action>

  <action method="addColumnCountLayoutDepend">

      <layout>two_columns_left</layout>

      <count>4</count>

  </action>

  <action method="addColumnCountLayoutDepend">

      <layout>two_columns_right</layout>

      <count>4</count>

  </action>

  <action method="addColumnCountLayoutDepend">

      <layout>three_columns</layout>

      <count>3</count>

  </action>

  <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>

</block>

<block type="catalog/layer_view" name="cms_layer" as="cms_layer" before="-">

    <action method="setCategoryId"><category_id>3</category_id></action>

</block>

Also insert ID of desired category in 3 (2 times). Open desired category of your store through Catalog->Manage Categories. Make sure that Is Anchor=Yes on Display Settings tab.

Amit Bera
  • 7,581
  • 7
  • 31
  • 57
0

One possible reason layered navigation does not show is because you also need to configure your attributes to show in layered navigation.

Coffee123
  • 156
  • 2
  • 9