Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Koen Cleynhens
Ho to enable "show add application" in custom made layout type?
April 19, 2010 1:07 PM
Answer

Koen Cleynhens

Rank: Junior Member

Posts: 83

Join Date: February 23, 2010

Recent Posts

Hello I made a custom layout type (based on the one of portlets)

But I see now that I don't be able to add a new application.

I checked it out and debugged it, and I see that there is a property showAddApplicationItem. But this property is only set to true in a preservice method if layout type is portlets.

Anybody knows how to modify this?
Ivan Cheung
RE: Ho to enable "show add application" in custom made layout typ
April 19, 2010 8:13 PM
Answer

Ivan Cheung

LIFERAY STAFF

Rank: Regular Member

Posts: 113

Join Date: June 20, 2006

Recent Posts

Hi,

It would help if you specified what you mean by "layout type". In the portal, you have page layout templates, and perhaps some other components that refer to layout.

What do you mean that you can't add a new application? You can't add a portlet to the page?
Koen Cleynhens
RE: Ho to enable "show add application" in custom made layout typ
April 29, 2010 1:13 AM
Answer

Koen Cleynhens

Rank: Junior Member

Posts: 83

Join Date: February 23, 2010

Recent Posts

Yep I cannot add a new Portlet in this layout type.

And the reason is that in the code of Liferay there is a check to see if the menu item "add application" is allowed for the layout type. And the only layout type where it is allowed is hardcoded specified in the code (unbelievable in my point of view)
Lior Hadaya
RE: Ho to enable "show add application" in custom made layout typ
July 25, 2012 3:29 AM
Answer

Lior Hadaya

Rank: Regular Member

Posts: 138

Join Date: January 24, 2012

Recent Posts

Hi, I'm facing the same problem

Did you ever manage to find a solution?

Thanks
Pinkesh Gandhi
RE: Ho to enable "show add application" in custom made layout type?
July 25, 2012 4:38 AM
Answer

Pinkesh Gandhi

Rank: Regular Member

Posts: 100

Join Date: January 26, 2012

Recent Posts

Can you verify that you have logged in with Admin rights before you are trying to add portlet on page.
Lior Hadaya
RE: Ho to enable "show add application" in custom made layout type?
July 25, 2012 4:40 AM
Answer

Lior Hadaya

Rank: Regular Member

Posts: 138

Join Date: January 24, 2012

Recent Posts

Yes, absolutely. I log in with the the administrator account, I can add portlets to regular pages of type "portlet".
Pinkesh Gandhi
RE: Ho to enable "show add application" in custom made layout type?
July 25, 2012 4:56 AM
Answer

Pinkesh Gandhi

Rank: Regular Member

Posts: 100

Join Date: January 26, 2012

Recent Posts

Please go through the steps mentioned in this link to create custom layout type.

I hope it may helps you.
Lior Hadaya
RE: Ho to enable "show add application" in custom made layout type?
July 25, 2012 5:00 AM
Answer

Lior Hadaya

Rank: Regular Member

Posts: 138

Join Date: January 24, 2012

Recent Posts

That's exactly what I did.
I was able to create a custom layout type and I can see my new layout type in the create/manage page dialog just fine.
 1layout.types=portlet,panel,embedded,article,url,link_to_layout,my_new_layout
 2
 3layout.edit.page[my_new_layout]=
 4layout.view.page[my_new_layout]=/portal/layout/view/portlet.jsp
 5layout.url[my_new_layout]=${liferay:mainPath}/portal/layout?p_l_id=${liferay:plid}
 6layout.url.friendliable[my_new_layout]=true
 7layout.parentable[my_new_layout]=true
 8layout.sitemapable[my_new_layout]=false
 9layout.configuration.action.updatemy_new_layout]=true


The problem is that when I click the +Add link on the upper dockbar in order to add portlets to my page (which is of my_new_layout type) the menu only shows the add page link. It won't show the applications/portlets.

It seems that Liferay's implementation set hard-coded that portlets can only be added to pages of the portlet layout type.
My question is - is there any way to work around this?

Thanks
Pinkesh Gandhi
RE: Ho to enable "show add application" in custom made layout type?
July 25, 2012 6:54 AM
Answer

Pinkesh Gandhi

Rank: Regular Member

Posts: 100

Join Date: January 26, 2012

Recent Posts

Can you please try with following properties
1
2     layout.edit.page[my_new_layout]=/portal/layout/edit/portlet.jsp
3     layout.view.page[my_new_layout]=/portal/layout/view/portlet.jsp
4     layout.url[my_new_layout]=${liferay:mainPath}/portal/layout?p_l_id=${liferay:plid}&p_v_l_s_g_id=${liferay:pvlsgid}
5     layout.url.friendliable[my_new_layout]=true
6     layout.parentable[my_new_layout]=true
7     layout.sitemapable[my_new_layout]=true   
8     layout.first.pageable[my_new_layout]=true   


I hope it may works for you.
Lior Hadaya
RE: Ho to enable "show add application" in custom made layout type?
July 25, 2012 7:06 AM
Answer

Lior Hadaya

Rank: Regular Member

Posts: 138

Join Date: January 24, 2012

Recent Posts

Hi,
Thanks for your assistance, I tried your suggested properties but it did not help. The situation is the same.

I really think this is something that's hard-coded into Liferay, it doesn't matter how I configure my custom layout type properties.
Can someone confirm this? is there any way I can use a hook or something to override this behavior?

Thanks