Wednesday, 8 February 2012

Changing template layout through code in Magento

Magento developer need to change the template layout dynamically as per the client requirement. Here is the code. You can write it in the _prepareLayout() function:
$this->getLayout()->getBlock('root')->setTemplate('page/2columns-right.phtml');

5 comments :

  1. Where exactly is the facebook like link ?

    ReplyDelete
  2. Right below the post in the Share This section 2nd, image is the facebook like link

    ReplyDelete
  3. This really answered my problem, thanks!

    ReplyDelete
  4. Appreciate it for this post, I am a big fan of this web site would like to proceed updated.

    ReplyDelete
  5. You could definitely see your enthusiasm within the work you write. The world hopes for much more passionate writers like you who aren't afraid to say how they believe. Always go following your heart.

    PoIuYt

    ReplyDelete