« Back to Customization

Default User Portlets

(Redirected from 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 Attachments
55239 Views
Average (1 Vote)
The average rating is 5.0 stars out of 5.
Comments
Threaded Replies Author Date
Hi Manuj, I think this article is missleading.... Jorge Ferrer September 2, 2009 10:04 AM
Thank you Jorge, I want to change the title... Manoj Kumar Pradhan September 3, 2009 1:27 AM
I've just done it for you. I've also edited the... Jorge Ferrer September 3, 2009 8:23 AM
Thank you Jorge. Now it looks great and more... Manoj Kumar Pradhan September 6, 2009 10:04 PM
Thank you for this entry! This fixed all my... Ryan Connolly November 17, 2010 8:28 AM
Quick question: Is there a way to specify the... Ryan Connolly November 17, 2010 8:31 AM
So there are Page Templates and Site Templates.... Dana Oredson December 21, 2010 2:18 PM
Can anybody tell me where do we need to keep... Biresh Choudhury April 9, 2011 5:11 AM

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.
Posted on 9/2/09 10:04 AM.
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.
Posted on 9/3/09 1:27 AM in reply to 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
Posted on 9/3/09 8:23 AM in reply to Manoj Kumar Pradhan.
Thank you Jorge.
Now it looks great and more informative
Posted on 9/6/09 10:04 PM in reply to 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.
Posted on 11/17/10 8:28 AM.
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
Posted on 11/17/10 8:31 AM.
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?
Posted on 12/21/10 2:18 PM.
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".
Posted on 4/9/11 5:11 AM.