I need to have 2 newsletter blocks on same page. Second newsletter template is different from first one. So, how can i call same newsletter php logic and output it in 2 different pthml files (that will have different html structure inside). I hope i was clear about what i'm trying to do.

Thank you!


So you're layout XML may look something like this

<block type="newsletter/subscribe" name="newsletter" template="newsletter/subscribe.phtml" />

Simply use a different template. You should change the 'name' too, as long as the type renames the same you should be fine.

The 'type' describes which block class to use, so keep that the same and both blocks will have access to the same block class code.

  • Block name and type were things that confused me. so your answer is perfect! thanks a lot! :) – mageNoob Jun 29 '14 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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