1

How to move category navigation section after home page banner in magento 2.2 class="sections nav-sections"

and my current site link in magento 2.2 and link and screen short please check

solivr.mobilegiz.com

please check magento 1.9 site link and screen short

www.solivr.fr

please advance help for thanks.

0

You can not move your banner if you have added your banner in admin cms homepage.

You have to create and call a custom phtml file and then add your banner in that file.

Create following file

app/code/Vendor/Module/view/frontend/layout/cms_index_index.xml

<?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>
        <referenceContainer name="page.top">
            <block class="Magento\Framework\View\Element\Template" name="homepage.banner" before="navigation.sections" template="Vendor_Module::homepage_banner.phtml" />
        </referenceContainer>
    </body>
</page>

Create following file and add your banner here

app/code/Vendor/Module/view/frontend/templates/homepage_banner.phtml

<?php

echo "Add your banner here";
3
  • homepage_banner.phtml ma html code muki dau ne May 9 '18 at 8:22
  • Yes @RavindrasinhZala May 9 '18 at 8:57
  • Has your issue been resolved? May 10 '18 at 4:27
0

Create the following file

app/code/[Name_Space]/[Your_Module]/view/frontend/layout/cms_index_index.xml

<?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>
       <move element="navigation.sections" destination="header-wrapper" after="homepage.banner"/>
    </body>
</page>

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.