« 返回到 Customization

Default User Portlets

(从 Associating a portlet To A page 进行重定向)

Introduction #

During liferay customization one common requirement is to configure the default portlets that are added to the pages of users or to the default guest community. For example instead of showing the portlets "Hello World" or "Currency Converter" we may want to show some custom portlets called "AboutUs" and "OurMileStones".

Default user public and private pages #

Like most of the configuration options in Liferay they are specified in the file Portal.properties. The default configuration looks like this:

    #
    # Set the portlet ids for the columns specified in the layout template.
    #


    default.user.public.layout.column-1=82,23

Where 82,83 are the portlet id (portlet-name) of the portlets "Alerts" and "Language" respectively. The id of the portlet is specified in the portlet.xml file. If the portlet is distributed as part of a plugin the name of the plugin is suffixed as shown below with the following format:

porltetName_WAR_warFileNameAs an example let's assume that we have developed two new portlets called "AboutUs" and " OurMileStones". We are distributing them within a plugin called MyCompany.war. To add these portlets by default in the private make this portlet default for user public lay out, edit portal-ext.properties as follows.

default.user.public.layout.column-1=AboutUs_WAR_MyCompany,OurMileStones_WAR_MyCompany

The example in the previous seciton was showing how to change the portlets available in the area of the page referred to as "column-1". Usually all areas are named with the prefix "column-" followed by a number from 1 to 10 (the actual names may vary depending on the Layout Templates being used). For example:

    default.user.public.layout.column-2=11,29,8,19
    default.user.public.layout.column-3=
    default.user.public.layout.column-4=

It's also possible to follow a very similar set of properties to specify the default portlets of the private pages of a user:

    default.user.private.layout.column-1=
    default.user.private.layout.column-2=
    default.user.private.layout.column-3=
    default.user.private.layout.column-4=

How to provide different configurations based on the user profile #

If you need different configuration based on the user profile check How To Use User Group Page Templates

Default portlets for the Guest community #

It's also possible to specify through configuration the default portlets shown in the public pages Guest community. Just follow the same instructions as those of the previous section with the following properties

    default.guest.public.layout.column-1=58
    default.guest.public.layout.column-2=47
    default.guest.public.layout.column-3=
    default.guest.public.layout.column-4=
0 附件
55258 查看
平均 (1 投票)
满分为 5,平均得分为 5.0。
评论
讨论主题回复 作者 日期
Hi Manuj, I think this article is missleading.... Jorge Ferrer 2009年9月2日 上午10:04
Thank you Jorge, I want to change the title... Manoj Kumar Pradhan 2009年9月3日 上午1:27
I've just done it for you. I've also edited the... Jorge Ferrer 2009年9月3日 上午8:23
Thank you Jorge. Now it looks great and more... Manoj Kumar Pradhan 2009年9月6日 下午10:04
Thank you for this entry! This fixed all my... Ryan Connolly 2010年11月17日 上午8:28
Quick question: Is there a way to specify the... Ryan Connolly 2010年11月17日 上午8:31
So there are Page Templates and Site Templates.... Dana Oredson 2010年12月21日 下午2:18
Can anybody tell me where do we need to keep... Biresh Choudhury 2011年4月9日 上午5:11

Hi Manuj,

I think this article is missleading. What you describe is not how to associate a portlet to a page, but to change the portlets that appear by default when a user logs in.

Also you added way too many tags which make them not very useful.

Please fix these issues so that the article can be kept in the wiki.
在 09-9-2 上午10:04 发帖。
Thank you Jorge, I want to change the title "Associating a portlet To A page" To "How to change the portlets that appear by default when a user logs in".
This is more relevent.
But I am new to this wiki, could you please guide me how to change the title ?
( Shall I create a new wiki page with this new name ? )

Regarding the content I will edit ASAP.
在 09-9-3 上午1:27 发帖以回复 Jorge Ferrer
I've just done it for you. I've also edited the article to make it comply with the style guidelines and added some additional information.

Thanks Manoj
在 09-9-3 上午8:23 发帖以回复 Manoj Kumar Pradhan
Thank you Jorge.
Now it looks great and more informative
在 09-9-6 下午10:04 发帖以回复 Jorge Ferrer
Thank you for this entry! This fixed all my issues related to specifying the default portlets in user's private pages. After getting discouraged because the information in the following thread was not working for me on LR 6.0.5, finding this post was just the thing I needed!

http://www.liferay.com/community/forums/-/message_boards/message/246440

Th­anks, again.
在 10-11-17 上午8:28 发帖。
Quick question: Is there a way to specify the default private page TYPE? I would like instead of Portlet page type a Panel page type.

Thanks in advance,
-Ryan
在 10-11-17 上午8:31 发帖。
So there are Page Templates and Site Templates. Is there no way to make the user "home pages" use one of these?

I had thought to create a site template and associate that template with a User Group, then give my power users that user group (instead of Power User?). I have a feeling that won't be quite right. It won't really be the user's pages to modify at that point, but a "common area" where users of that user group can do stuff. Is that right?

I'm trying to avoid doing things with the portal-ext.properties, because that takes a deployment and restart of the server (and coordination with someone on the admin team - ugh.).

Thoughts?
在 10-12-21 下午2:18 发帖。
Can anybody tell me where do we need to keep the war file. Do I need to keep the war file inside DEPLOY folder of liferay and once it's deployed same name needs to be given for the property "default.user.public.layout.column-1".
在 11-4-9 上午5:11 发帖。