3

I want to have a category page as part of my homepage that also shows the pagination and, most importantly, the filter.
I'm using this extension to change the filter to a horizontal one that uses AJAX to reload the page after a filter has been changed. I also want it to function normally.

I got a few ideas which include:

  • Make the category page the homepage (suggested by the developer of above mentioned extension)
  • Insert the products, toolbar and filter as a block

Both of them have their downsides, though.

For the first one I'd have to copy the category page that I want to display, which results in me having to edit the product importer that I'm using, what I don't really want to have to.

I tested the second idea and the results were... strange. I used this code:

<block type="catalog/product_list"  name="home-products" template="catalog/product/list.phtml">
    <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="setCategoryId"><category_id>77</category_id></action>
    <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
<block type="catalog/layer_view" name="catalog.topnav" before="home-products" template="catalog/layer/view.phtml"/>

which showed me the items and the toolbar at the correct location but inserted the navigation at the top of the content (just below the header) and it also didn't have any effect (didn't filter the listed products).

Maybe you can help me figure out what I am doing wrong or even point me in a totally different direction.

1 Answer 1

0

This should work

<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
        <action method="setCategoryId"><category_id>77</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>

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.