1
votes

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.

4

4 Answers

1
votes

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

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

1
votes

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.

0
votes

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