Sunday, April 1, 2012

Magento Newsletter Subscribe Form in Footer or Header

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.



<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>

1 comment:

Thankyou for your Comments

LinkWithin

Blog has moved, searching new blog...