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?


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"/>

Then cleared cache.

enter image description here

| improve this answer | |
  • 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 Jun 22 '17 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/…> – Nitesh Jun 23 '17 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 Jun 25 '17 at 12:46
  • @Abhishek Have you got any solution? If no then plz post new question with your requirements? – Nitesh Jun 30 '17 at 5:54
  • I have already posted .. magento.stackexchange.com/questions/172674/… – Abhishek Jun 30 '17 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.