0

I would like to add a div inside <main id="maincontent" class="page-main"> from my custom module please look at screen shoot:

enter image description here

Can you see a class="MYCUSTOMBLOCKHERE" in the image I need to add this div.

Any help I Appreciate. Thanks

1

Add <move> tag to make it before page messgae.

<move element="custom.view.container" destination="columns.top" before="page.messages" />
  • Thanks this work too ! is there a list of this names tha one can refer to? – Juliano Vargas Nov 15 '17 at 20:15
1

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.

1
<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>
</referencache andr>

Flush cache and clear cache and check it.

you can find all block name into

vendor\magento\module-theme\view\frontend\layout\default.xml

  • @Juliano Vargas is that works? – Sunil Patel Nov 15 '17 at 20:04
  • Great! thanks. actually the correct name was page.main.title Do you know where I can find all this names like a list of it? – Juliano Vargas Nov 15 '17 at 20:14
  • added :) that file – Sunil Patel Nov 15 '17 at 20:17

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.