Saturday, September 14, 2013

Magento Add Block DIV Wrapper/Container Using Template

Problem:
How to wrap block html in a div wrapper/container (and set class name) using a template file (e.g. local.xml).

Solution:
e.g. wrap a div wrapper/container around the standard Magento newsletter subscribe block.

<block type="page/html_wrapper" name="subscribe.container" translate="label">
    <label>Subscribe Container</label>
    <action method="setElementClass"><value>subscribe-container</value></action>
    <block type="newsletter/subscribe" name="newsletter" after="leftMenu" template="newsletter/subscribe.phtml"/>
</block>

17 comments:

  1. Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. magento2 shipping rates

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
    logo design company chennai

    ReplyDelete
  4. Open source softwares, such as - Magento were founded on the idea and belief that you shouldn't be locked down to so many specifications and in many ways to limitations. plakatų dizainas

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include.
    spotify free

    ReplyDelete
  8. Everyone wants more conversion from their eCommerce sites. Increased conversion means more sales. More sales mean more revenue. Learn why Magento software is used by 100's of thousands of vendors to power their eCommerce business. affordable website design

    ReplyDelete
  9. Certsout.com provides authentic IT Certification exams preparation material guaranteed to make you pass in the first attempt. Download instant free demo & begin preparation. 3313 Exam Practice Test

    ReplyDelete
  10. Nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! Best Wireless Charging for Google pixel 2 XL

    ReplyDelete
  11. I am continually amazed by the amount of information available on this subject. What you presented was well researched and well worded in order to get your stand on this across to all your readers. Cliquez-ici

    ReplyDelete
  12. The information you have posted is very useful. The sites you have referred was good. Thanks for sharing.. Top Portal

    ReplyDelete
  13. Awesome things you've generally imparted to us. Simply continue written work this sort of posts.The time which was squandered in going for educational cost now it can be utilized for studies.Thanks Magento developers

    ReplyDelete
  14. Depends upon immediately is shifting for the features that web provides. Utilizing web with your current browsers and download twitter videos virtually any articles that you just want to have is usually a straightforward activity to be able to perform, the question is how fast do we all perform these jobs

    ReplyDelete
  15. Great content material and great layout. Your website deserves all of the positive feedback it’s been getting. view site…

    ReplyDelete