Foren

get the layout in theme

kumar E, geändert vor 9 Jahren.

get the layout in theme

Junior Member Beiträge: 64 Beitrittsdatum: 04.10.12 Neueste Beiträge
Hi All,

I need to check which layout is applied to a page from protal_normal.vm
could you please help me on this.

EX: the current page has 70-30 layout (or) the page has one column

Thank you,
vinod
thumbnail
Prakash Khanchandani, geändert vor 9 Jahren.

RE: get the layout in theme (Antwort)

Expert Beiträge: 329 Beitrittsdatum: 10.02.11 Neueste Beiträge
The theme template init.vm already has a layout object through which you can find out the layout template of the page.

In a proper jsp or java class you would fetch the current layout of the page and its template as follows:

<%
String layoutTemplateId = themeDisplay.getLayoutTypePortlet().getLayoutTemplateId();
%>


Fortunately in velocity template it is same:

#set ($current_page_template_id = $theme_display.getLayoutTypePortlet().getLayoutTemplateId()) 


What it does is it takes the template-id from the typeSettings column of the Layout table, this would give you the template-id but if you want the template name like we see on the UI then you can simply do:

#set ($current_page_template_name = $theme_display.getLayoutTypePortlet().getLayoutTemplate().getName()) 


Hope this helps.
Merjan Shushollari, geändert vor 8 Jahren.

RE: get the layout in theme

New Member Beitrag: 1 Beitrittsdatum: 08.09.15 Neueste Beiträge
What about developing a new theme from scratch. Liferay doesn't seem to provide flexibility in the development and customization of themes. I read somewhere that to develop a new theme I need Liferay IDE
thumbnail
Prakash Khanchandani, geändert vor 8 Jahren.

RE: get the layout in theme

Expert Beiträge: 329 Beitrittsdatum: 10.02.11 Neueste Beiträge
Merjan Shushollari:
I read somewhere that to develop a new theme I need Liferay IDE

You only need the plugins SDK. Liferay IDE makes the process a lot simple but it is not a need.

Merjan Shushollari:
What about developing a new theme from scratch.

You can create your theme with parent-theme as "_unstyled", this does not have any styled elements. With this you can build your own stylesheets and do not have to override any other liferay CSS.

Hope this helps.

Note: And it would help if you could post a separate thread instead of hijacking other threads.
Thanks