Create block between header and main
-
08-01-2021 - |
Question
I am facing issue with creating a block between header.container
and main
. so that I can put the banner over there. And I need the banner in home page only
please help me for the same.
Solution
I have tried and its working for me.
<referenceContainer name="page.wrapper">
<container name="page.wrapper.second" as="page_wrapper_second" htmlTag="div" htmlClass="my-custom-div" before="main.content">
<block class="Magento\Cms\Block\Block" name="your_banner_block">
<arguments>
<argument name="block_id" xsi:type="string">your_banner_block</argument>
</arguments>
</block>
</container>
</referenceContainer>
You have to place your banner block instead of "your_banner_block" block.
OTHER TIPS
You can use Widget
- On the Admin Panel
Content > Elements > Widgets
- In the upper-right corner of Widgets workplace, click on Add New Widget button.
- In the Settings section:
- Choose CMS Static Block type in the Type box.
- Choose the current theme you are applying in the Design Theme.
- Click Continue button.
I have found the answer ...that we should create the custom xml file for that ..and assign the custom xml to the home page from admin side..mention in the custom xml whatever we want and positions..then it will come
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange