CMS page with layered navigation not working
Asked Answered
C

4

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.

Christoforo answered 20/1, 2014 at 18:9 Comment(0)
I
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> 
Insalubrious answered 20/1, 2014 at 19:16 Comment(3)
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?Humbertohumble
@AmitBera your link is broken.Outspread
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?Snore
I
2

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

Irreclaimable answered 1/8, 2014 at 16:11 Comment(0)
I
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> 
Insalubrious answered 20/1, 2014 at 19:16 Comment(3)
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?Humbertohumble
@AmitBera your link is broken.Outspread
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?Snore
I
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.

Insalubrious answered 20/1, 2014 at 19:22 Comment(0)
L
0

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

Lennie answered 29/9, 2015 at 14:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.