I need to add layered navigation on my home page. It is available on other pages but not in Homepage. I have tried this one too -> Magento 2 How to show Layered Navigation on home page? , but it is not working for me.

How to add this to the homepage?


You just need to create app/design/frontend/<Vendor>/<theme>/Magento_Cms/layout/cms_index_index.xml with such content:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <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"/>
| improve this answer | |
  • Thanks but this is not working. Do you have any idea? – SMash Jun 5 '18 at 8:58

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.