Going a bit nuts trying to get my head around this. Debug mode doesn't help me.
I'm trying to add a block just before the
</header> on only Product Pages. I've created a phtml file with my content (banner). And I've added the below code to:
<referenceContainer name="root"> <block class="Smartwave\Porto\Block\Template" name="banner" template="Magento_Catalog::product/view/banner.phtml"/> </referenceContainer> <move element="banner" destination="header" after="-"/>
In my head, the above:
- Loads Block in the root of the page with
- Then moves the Block to the
<move element="banner" destination="header"...
- And puts it at the very bottom:
Clearly though, it does not. I've used a ton of trial-and-error with varying results. It either loads in places I don't want or doesn't appear at all.
It appears that
</header> is part of
header.phtml and so I cannot accomplish what I set out to to do.
However, I'd also be happy with the block loading BETWEEN
<div class="breadcrumbs">. This seems more achievable having looked closer at the code.