I have a custom phtml file that I've included on the homepage, this has several divs that call in static blocks. Here is a simplified version:
<div class="my-div-1">
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('my_block_1')->toHtml();?>
</div>
<div class="my-div-2">
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('my_block_1')->toHtml();?>
</div>
And here is how I've called it in on the homepage:
<referenceContainer name="main">
<block class="Magento\Framework\View\Element\Template" name="homepage_content" template="Magento_Cms::homepage-content.phtml" />
</referenceContainer>
In my cms_index_index.xml
I want to move the cms content block between .my-div-1
and .my-div-2
but I'm struggling to get the right reference. I currently have it wrapped in a div as follows:
<referenceContainer name='content'>
<container name='homepage-section' as='homepage-section' htmlTag='div' htmlClass='homepage-section cms' />
</referenceContainer>
<move element='cms_page' destination='homepage-section'/>
Can someone help me with moving this between my 2 divs please, or can it not be done?