Foros de discusión
get the layout in theme
kumar E, modificado hace 9 años.
get the layout in theme
Junior Member Mensajes: 64 Fecha de incorporación: 4/10/12 Mensajes recientes
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
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
Prakash Khanchandani, modificado hace 9 años.
RE: get the layout in theme (Respuesta)
Expert Mensajes: 329 Fecha de incorporación: 10/02/11 Mensajes recientes
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:
Fortunately in velocity template it is same:
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:
Hope this helps.
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, modificado hace 8 años.
RE: get the layout in theme
New Member Mensaje: 1 Fecha de incorporación: 8/09/15 Mensajes recientes
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
Prakash Khanchandani, modificado hace 8 años.
RE: get the layout in theme
Expert Mensajes: 329 Fecha de incorporación: 10/02/11 Mensajes recientesMerjan 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