Foros de discusión

Dynamically change the layout of the portal

Dan Scully, modificado hace 11 años.

Dynamically change the layout of the portal

Junior Member Mensajes: 48 Fecha de incorporación: 13/10/11 Mensajes recientes
The default, landing layout of my portal is a narrow two-column layout.
Is it possible to change the layout (at least, the width of the two columns) when I enter the maximized view of a portlet?

To be precise, here's the scenario:
When I enter a page I have two columns, centered, 1000px of width.
When I select one portlet and set it to maximized view, the layout is different: let's say 100% of width.
When I return to normal view, the layout returns to the fixed-width one.

Is it possible?
thumbnail
Sharana Basavaraj Ballari, modificado hace 11 años.

RE: Dynamically change the layout of the portal

Regular Member Mensajes: 139 Fecha de incorporación: 10/09/07 Mensajes recientes
Hi Dan,

You have a two column layout(2_column.tpl) and have a portlet in each column.

When you maximise one of the portlet, by default you will get a 100% width. and it allocates layout template called max.tpl

What you are expecting is available by default. If this is not what you are expecting, explain your scenario in detail. Apologies I would have wrongly understood your question. comments welcome.

HTH,
Sharan
Dan Scully, modificado hace 11 años.

RE: Dynamically change the layout of the portal

Junior Member Mensajes: 48 Fecha de incorporación: 13/10/11 Mensajes recientes
My current normal layout:
My current maximized layout:

My dream maximized layout:

Please appreciate my excellent MS Paint drawing skills emoticon
Dan Scully, modificado hace 11 años.

RE: Dynamically change the layout of the portal

Junior Member Mensajes: 48 Fecha de incorporación: 13/10/11 Mensajes recientes
bump
thumbnail
Sandeep Nair, modificado hace 11 años.

RE: Dynamically change the layout of the portal

Liferay Legend Mensajes: 1744 Fecha de incorporación: 6/11/08 Mensajes recientes
Hi,

From what I have seen Menu is not a portlet holder. Its something that you have created of your own in theme.

So you have to hide the menu in theme yourself. One way can be to you $portlet_display object to hide it something like following

#if ($portlet_display.isStateNormal())
  //show your menu
#end


Regards,
Sandeep
Dan Scully, modificado hace 11 años.

RE: Dynamically change the layout of the portal

Junior Member Mensajes: 48 Fecha de incorporación: 13/10/11 Mensajes recientes
So if this variable is set to false, it means that one of the portlets is in the maximized view, right? And I can actually have 2 separate layouts based on checking this variable.. nice idea emoticon

Unfortunately, it seems that the portletDisplay object is not available in portal_normal.vm that I am customizing .., So what now??
thumbnail
Sandeep Nair, modificado hace 11 años.

RE: Dynamically change the layout of the portal

Liferay Legend Mensajes: 1744 Fecha de incorporación: 6/11/08 Mensajes recientes
Hi Dan,

I tested it out myself and it did not work as you wanted. It was always returning me false irrespective of what state the portlet is in.

Luckily I found another variable which is working so please try this

#if($is_maximized)
 //Hide the menu
#end


Regards,
Sandeep
Dan Scully, modificado hace 11 años.

RE: Dynamically change the layout of the portal

Junior Member Mensajes: 48 Fecha de incorporación: 13/10/11 Mensajes recientes
Works like a charm

Thank you very much emoticon