1

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

  • have seen the any configuration at admin>Store>configuration section. – Amit Bera Nov 3 '16 at 8:36
  • 1
    @AmitBera yes there is a section titled Sebwite where i have set default category which i want to show. but where to write this in Sebwite\Sidebar\Block\Sidebar in theme??? – smarttechy Nov 3 '16 at 8:40
1

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>
  • i want to show top menu in left side of every page like in and remove from top like in banggood.com . – smarttechy Nov 3 '16 at 8:50
  • Where to add your first xml code please specify files . I'm new to magento and using magento 2 – smarttechy Nov 3 '16 at 8:51
  • ok, use the XML reference for that, also you should remove the main navigation with xml, try with the following code: – Vlad Patru Nov 3 '16 at 8:52
  • <referenceContainer name="sidebar.main"> <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav.aside" template="html/topmenu-aside.phtml" ttl="3600" before="-"/> </referenceContainer> – Vlad Patru Nov 3 '16 at 8:53
  • where i have to put this code? – smarttechy Nov 3 '16 at 8:54

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.