0

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?

2

1 Answer 1

0

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">
    <body> 
        <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>
    </body>
</page>
1
  • Thanks but this is not working. Do you have any idea?
    – SMash
    Commented Jun 5, 2018 at 8:58

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.