I would like to know how I can add static block to newsletter subscriber templates


You can add static block in any template using this code

echo $this->getLayout()->createBlock('cms/block')->setBlockId('my-new-block')->toHtml();

You first have to create static block add your block id instead of my-new-block.

  • i am using this code code its not working – Sarvesh Tiwari Nov 9 '16 at 13:03
  • Where is your newsletter.phtml is located ? – user46927 Nov 9 '16 at 13:06
  • {magento root path}/app/design/frontend/{your package}/{your theme}/template/newsletter – Sarvesh Tiwari Nov 9 '16 at 13:09
  • 1
    have you confirmed by template path hints ? also clear your cache,. – Rajan Soni Nov 9 '16 at 13:12
  • 1
    @Rajan thanks for reply now its working for me – Sarvesh Tiwari Nov 10 '16 at 5:58

You can edit your newsletter subscribe template file and call static block with following code :

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?> 

Newsletter file will be in following path :

{magento root path}/app/design/frontend/{your package}/{your theme}/template/newsletter

  • i used your code but it did not work ... – Sarvesh Tiwari Nov 9 '16 at 13:02
  • have you put above code in above path subscribe.phtml file? – user46386 Nov 9 '16 at 13:07
  • Please check your file path using template path hint then put above code and clear cache because this is working. – user46386 Nov 9 '16 at 13:14

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.