I have a custom-footer in my website. I want to move newsletter to my custom footer. I tried the below code to move but nothing changes.
move element="form.subscribe" destination="custom_footer"
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI have a custom-footer in my website. I want to move newsletter to my custom footer. I tried the below code to move but nothing changes.
move element="form.subscribe" destination="custom_footer"
If your custom_footer
element is a block you'll also need to call getChildHtml in your assigned template like so:
<?php echo $block->getChildHtml(); ?>
Or you can call getChildHtml with the name of the block for more control:
<?php echo $block->getChildHtml('form.subscribe'); ?>
Please make sure custom footer code should be correct. refer blow:
<referenceContainer name="custom.footer">
</referenceContainer>
<move element="form.subscribe" destination="custom.footer" before="-" />
<referenceContainer name="custom_footer">
<block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/>
</referenceContainer>