2

I want to show Layered Navigation on Home Page.

On home page their is banner slider and on banner image their is Search Box like below.

enter image description here

Now I want show Layered Navigation instead of that search box.

And I can remove that search box but Don't know

How to show Layered Navigation on Home Page?

3

1 Answer 1

4

To show layered navigation on home page do following->

Edit CMS homepage, inside it in design tab -> layout -> selected "2 columns with left bar". Then added following code in design-> Layout Update XML

<referenceContainer name="sidebar.main">
        <block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" before="-" template="layer/view.phtml">
            <block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalog.navigation.state" as="state" />
            <block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalog.navigation.renderer" as="renderer" template="layer/filter.phtml"/>
        </block>
    </referenceContainer>

Then cleared cache.

enter image description here

5
  • What will be condition if want layered navigation for particular category ID ? I was able to get in Magento 1 but not in Magento 2
    – Abhishek
    Commented Jun 22, 2017 at 20:55
  • @Abhishek You need to add category filter for advanced search and then pass your category_id as parameter in url (hidden variable) then it will show layered navigation for that specific category. To add category filter you can refer this <magento.stackexchange.com/questions/176502/…> Commented Jun 23, 2017 at 5:46
  • Thanks for your reply. But I want this on custom page. Suppose I want all filter attribute of category id 10 on "about us" page left side bar.
    – Abhishek
    Commented Jun 25, 2017 at 12:46
  • @Abhishek Have you got any solution? If no then plz post new question with your requirements? Commented Jun 30, 2017 at 5:54
  • I have already posted .. magento.stackexchange.com/questions/172674/…
    – Abhishek
    Commented Jun 30, 2017 at 9:15

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.