Magento NewsLetter Subscribe Form Code to Footer


It used to be the case that to move your Newsletter Subcribe form, or other Magento blocks, from their original position in your Magento template you would need to go and find the relevant lines in the layout XML files and modify them to show in a new postition. This however was a tedious process; especially when it came to precise positioning on your page.
Now you can create a block on the fly and position it precisely in your template files with one line of code. So here it is…
?
1
<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>

2 comments:

your work is great save couple of hours thank you

March 6, 2014 at 8:52 PM comment-delete

magento extension development is very crucial for coders.

July 2, 2014 at 6:35 AM comment-delete

Post a Comment