Sometime it may required to add the newslettersubscribe box in Header or Footer.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.
create a block on the fly and position it precisely in your template files with one line of code.
create a block on the fly and position it precisely in your template files with one line of code.
<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>
Thanks for this, Ive been looking for this code for ages!
ReplyDelete