Liferayは6年連続でGartner Magic Quadrantのリーダーに。 詳細はこちら
« Customization に戻る

Default User Portlets

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 添付ファイル
45614 参照数
平均 (1 投票)
平均評価は5.0星中の5です。
コメント
コメント 作成者 日時
Hi Manuj, I think this article is missleading.... Jorge Ferrer 2009/09/02 10:04
Thank you Jorge, I want to change the title... Manoj Kumar Pradhan 2009/09/03 1:27
I've just done it for you. I've also edited the... Jorge Ferrer 2009/09/03 8:23
Thank you Jorge. Now it looks great and more... Manoj Kumar Pradhan 2009/09/06 22: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 14:18
Can anybody tell me where do we need to keep... Biresh Choudhury 2011/04/09 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/09/02 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.
Jorge Ferrerへのコメント。投稿日時:09/09/03 1:27
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
Manoj Kumar Pradhanへのコメント。投稿日時:09/09/03 8:23
Thank you Jorge.
Now it looks great and more informative
Jorge Ferrerへのコメント。投稿日時:09/09/06 22:04
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 14: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/04/09 5:11