1

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"

1

3 Answers 3

0

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'); ?>
0

Please make sure custom footer code should be correct. refer blow:

 <referenceContainer name="custom.footer">

 </referenceContainer>

<move element="form.subscribe" destination="custom.footer" before="-" />
2
  • I have given the destination name same as the name of container. Now it works but it is not appearing in the div of footer
    – Ayaz
    Feb 9, 2018 at 10:46
  • Can you please show me your xml code? Feb 9, 2018 at 11:04
0
   <referenceContainer name="custom_footer">
        <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/>
    </referenceContainer>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.