B-219 Sec-55 Noida, India
+918010221733

Magento : Change page layout from controller

Just you need to replace one line of code in your controller
where you want to change the layout of the page if you are not
able to do from xml through setlayout.

Replace
$this->loadLayout();

with
$this->loadLayout()->getLayout()
->getBlock(‘root’)->setTemplate(‘page/1column.phtml’);

(Visited 74 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.