Thursday, May 20, 2010

Liferay: How to add more than one layout?

I created template layout using plugIns SDK. Then ant inserted myportal-layouttpl with first layout with 1-3-1 (three rows with three columns for the second row). I renamed this template layout as 'mainpage'.

But for certain page, I need another layout style, let say 1-2 (two rows where the second row has two columns). The second template named as 'subpages'.

This layout TEMPLATE not included bottom part since footer part already included in portal_normal.vm.

The colored parts in the figure technically written in 1-3-1.tpl (main_page) and 1-2.tpl (subpages). The second layout template can be added like this;
Open liferay-layout-template.xml : Path ~/plugins/layouttpl/myportal-layouttpl/docroot/WEB-INF
Add this before custom tag.

Then do not forget to do ant deploy.