Yoast landing pages module with layered navigation

First, a thanks to the team at Yoast for a handy little module. We needed to add layered navigation to the result pane, but it appears others were struggling with a solution – so here’s the answer!

Create your CMS brand/focus page as normal, then add the Yoast_Filter block:

<reference name="content">

<block type="Yoast_Filter/Result" name="filter_result" template="catalog/product/list.phtml">

<action method="setColumnCount"><column_count>4</column_count></action>
<action method="setAttributeName"><attribute_name>product_categories</attribute_name></action>
<action method="setValue"><value>4441</value></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" template="page/html/pager.phtml" />  
</block>
  
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>

</reference>

And underneath add the code to load the layered navigation in the left pane:

<reference name="left">
  <block type="Yoast_Filter/Layer_View" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>

Then set your layout to "2 columns right". This is a bit of a caveat, due to the arguments being set in the block, the layered navigation block must be physically after the content block in the source code. When my brain is thinking straight, I'll figure out the fix, but in the mean-time, you can just float col-right left and col-main right, to get your 2 column left layout back.

That's it! But you'll need to use using our updated version of Yoast_Filter - which includes the extra functionality required for layered navigation. You can download it using the link below.


Download Yoast Landing Pages (enhanced)

  • http://www.tritum.de Björn

    This is just great we’re looking for this feature since months. Do you have a live and workin example? Does the developer know about your great solution? Is he interested in joining your code to the recent version?

  • https://www.sonassi.com ben@sonassi.com

    Hi,

    I emailed Yoast, but to no avail.

    We have a few sites using it at the moment, all of which are in development – so no feature URLs as yet.

  • http://www.tritum.de Björn

    Thanks for your answer. Which Magento versionb do I need to run this extended module?

  • http://www.tritum.de Björn

    Okay. I’ve tested the module and I think it’s not possible to run it on Magento 1.3.2.4. Your Model/Layer.php is requiering Mage::getResourceModel(‘catalog/product_attribute_collection’). This class is only available in Magento 1.4.x. Too bad :( We need this functionality on Magento 1.3.2.x

  • https://www.sonassi.com ben@sonassi.com

    It could probably be made to work on 1.3.2 – but unless a client asks us to build it for them, its unlikely I would post the code here.

    If you want us to put it together for you, get in touch for a quote.

  • nadshez

    Can someone please guide me? I installed the code & it was kinda working, except that the result was incorrect .. and i would get 2 pages of resultset (10 items each), one on top of the other.

    So I uninstalled this & installed the Yoast extension, which apparently has the support for layered navigation now. It works fine without navigation, but when i gave the block in the xml area, i would get a error

    Fatal error: Call to a member function getSize() on a non-object in app\design\frontend\cleani\default\template\catalog\product\list\toolbar.phtml on line 39

    Can anyone tell me whats going on & how to fix it?! Thanks.

  • https://www.sonassi.com ben@sonassi.com

    Hi Nadshez,

    The code that is bundled into Yoast’s extension is our own! Have a look here:

    http://www.magentocommerce.com/magento-connect/Yoast/extension/1915/yoast-landing-pages

    Now the module also supports layered navigation for both the landing pages and the CMS pages. By default thelayered navigation is enabled for the dynamic pages. To remove this you should edit the filter.xml. To enable it for the CMS pages see the example at Yoast.com Thanks to Sonassi for he suggested code.

    Sounds like a pager bug, look at number 3. here https://www.sonassi.com/knowledge-base/magento-1-4-install-errors/

  • Astrid

    The price filters in the layered navigation apparently only filter the regular price, although they display the sale price ranges in the navigation. Is there a fix so that the price filters will display the products by their sale prices instead of just their regular price?

    Other than that bug, this is a fantastic plugin!

  • Vitor

    Hello Benjamin,

    Thank you very much for sharing this great solution.

    I’m having a lil problem and maybe you can help me fix it. I use some configurable atributes as filters on my store (size and color), they work well on the layered navigation of categories, but they are not working properly in the landing pages with layered navigation. They only return the simple products on results when selected, completely ignoring the configurable ones.

    The weird thing is that another “personalized” filter that im using (manufacturer) is actually working properly.

    Is there any way to fix it?

    Again, thank you very much!

  • http://www.marchionni.ch Eric

    Thanks for this great plugin!

    In Result.php around line 48 I had to change
    $collection->addAttributeToFilter($_filter->getFilter()->getRequestVar(), $_filter->getValue());
    to
    $collection->addAttributeToFilter($_filter->getFilter()->getRequestVar(), array('like' => '%'.$_filter->getValue().'%'));
    for custom attributes being filterable in the layered navigation.

    There’s one thing I’d like to achieve:
    If the CMS landing page lists all products where the multiselect attribute “taste” is “smokey” I don’t want the layered navigation to display the attribute “taste”.
    I know that I have to edit template/catalog/layer/view.phtml, but I don’t know how I can get the attribute that has been set in the cms page with setAttributeName.

    Any hints?

  • https://www.sonassi.com Benjamin

    Hi Eric,

    Its not the same thing, but this https://www.sonassi.com/knowledge-base/magento-knowledge-base/dependant-layered-navigation-filters-in-magento/ gives an indication on how to hide layered navigation filters based on their value.

  • http://www.jijwel.nl Erik

    I have the same problem with the Yoast extention i can not select configurable product. Does anyone have a solution?

  • Lucas

    Having the same issue!
    Configurable products are not filtered properly!
    Please help!

  • amadex

    Any news on configurable products filtering?… tkx!

  • Arwyl

    I have a problem when filtering by manufacturer. Setting the value to 4 retrieves not only the products of manufacturer id=4, but also of manufacturer id=14. The products of manufacturer 14 are all configurable products, so I’m not sure whether this problem is related to the configurable products bug. Any help would be much appreciated, thanks!

  • Matteo Dini

    Hello, I tried this great extension but I have a small problem .. Attributes are not filtered properly … 
        If I insert for example: 
        
        {{block type=”Yoast_Filter/Result” 
        name=”filter_result” 
        template=”catalog/product/list.phtml”  
        attribute_name=”color” 
        value=”24″ 
        }}
        
        
        view even an attribute different from that specified …. In this example, I view attribute 24 and 4.
        Do not do it with all … 
        How can I do? Thank you!

  • Matteo Dini

    Thank you Arwyl !!!

  • Eric

    Doesn’t work with Magento 1.7.0.2. Anybody knows a fix?