Magento – show categories on left side

categorymagento2navigation

I'm using this extension https://github.com/Sebwite/magento2-category-sidebar/
I have installed it but I'm struck at a configuration point
It says

You should implement the block Sebwite\Sidebar\Block\Sidebar in your theme to make this extension work. Example

But have no idea where to write it.

Anybody kindly help I'm using magento v2 .

I'm having this file structure
enter image description here

Best Answer

You need to create depending on what theme are you using the folder structure as following:

app/design/Magento/theme_name/Magento_Theme/layout/default.xml where theme_name has to be changed with the current active theme ( you can find that from the Magento admin, it's "luma" or "blank" but most likely is "luma"

So your final code for that file should be:

<?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\Theme\Block\Html\Topmenu" name="catalog.topnav.aside" template="html/topmenu-aside.phtml" ttl="3600" before="-"/>
        </referenceContainer>
        <referenceBlock name="catalog.topnav" remove="true" />
    </body>
</page>

Create the following structure for removing the catalog.left nav from Layered navigation

app/design/Magento/theme_name/Magento_LayeredNavigation/layout/catalog_category_view_type_layered.xml and add the following code

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="catalog.leftnav" remove="true" />
    </body>
</page>
Related Topic