フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド数 [ 前へ | 次へ ]
toggle
Dan Scully
Dynamically change the layout of the portal
2012/06/19 6:37
答え

Dan Scully

ランク: Junior Member

投稿数: 48

参加年月日: 2011/10/13

最近の投稿

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?
Sharana Basavaraj Ballari
RE: Dynamically change the layout of the portal
2012/06/19 13:55
答え

Sharana Basavaraj Ballari

ランク: Regular Member

投稿数: 128

参加年月日: 2007/09/09

最近の投稿

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
RE: Dynamically change the layout of the portal
2012/06/19 23:26
答え

Dan Scully

ランク: Junior Member

投稿数: 48

参加年月日: 2011/10/13

最近の投稿

My current normal layout:
My current maximized layout:

My dream maximized layout:

Please appreciate my excellent MS Paint drawing skills emoticon
Dan Scully
RE: Dynamically change the layout of the portal
2012/06/24 22:50
答え

Dan Scully

ランク: Junior Member

投稿数: 48

参加年月日: 2011/10/13

最近の投稿

bump
Sandeep Nair
RE: Dynamically change the layout of the portal
2012/06/24 22:59
答え

Sandeep Nair

ランク: Liferay Legend

投稿数: 1671

参加年月日: 2008/11/05

最近の投稿

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

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


Regards,
Sandeep
Dan Scully
RE: Dynamically change the layout of the portal
2012/06/24 23:46
答え

Dan Scully

ランク: Junior Member

投稿数: 48

参加年月日: 2011/10/13

最近の投稿

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??
Sandeep Nair
RE: Dynamically change the layout of the portal
2012/06/24 23:47
答え

Sandeep Nair

ランク: Liferay Legend

投稿数: 1671

参加年月日: 2008/11/05

最近の投稿

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
1
2#if($is_maximized)
3 //Hide the menu
4#end


Regards,
Sandeep
Dan Scully
RE: Dynamically change the layout of the portal
2012/06/24 23:57
答え

Dan Scully

ランク: Junior Member

投稿数: 48

参加年月日: 2011/10/13

最近の投稿

Works like a charm

Thank you very much emoticon