magento 2 How to add a div in main tag with custom phtml template in custom module
-
16-12-2020 - |
المحلول 2
Ok I've manage to ad like this But...
<referenceContainer name="columns.top">
<container name="custom.view.container" htmlTag="div" htmlClass="custom-view" after="page.title.wrapper">
<block class="company\module\Block\entity" name="customView" template="company_module::custom.phtml" />
</container>
</referenceContainer>
But it adds after page messages
not before.
نصائح أخرى
<referenceContainer name="columns.top">
<container name="custom.view.container" htmlTag="div" htmlClass="custom-view" before="page.messages">
<block class="company\module\Block\entity" name="customView" template="company_module::custom.phtml" />
</container>
</referenceContainer>
Flush cache and clear cache and check it.
you can find all block name into
vendor\magento\module-theme\view\frontend\layout\default.xml
Add <move>
tag to make it before page messgae.
<move element="custom.view.container" destination="columns.top" before="page.messages" />
لا تنتمي إلى magento.stackexchange