« Back

Portlet Ids Bookmarklet

Company Blogs November 2, 2007 By Minhchau Dang Staff

The nice thing about Liferay's drag and drop layout is that you (usually) don't have to remember any of the portlet ids. At least, until you do.

If you skim through portal.properties, there's a set of properties all prefixed with default.user.layout which let you control this. However, it wants portlet ids, which Liferay doesn't readily give to you unless you dig through /portal/portal-web, /ext/ext-web, and /plugins/portlets.

So, I wanted to create something which converted a layout, like this into a quick reference for all the different portlet ids, like this, Without digging through the backend and/or mousing over the configuration links.

So, while I'm not familiar enough with Liferay to implement a server-side way to do this, I dug through "view page source" and found that it was pretty straightforward to write a bookmarklet which, when run on a Liferay-based page, gives me the name-to-id mapping for all the portlets currently on the page in a Liferay.Popup.

To use it, convert the script below into a bookmarklet (you can use use this one which turns up in a Google search) and paste the bookmarklet into your address bar. Voila! Instant popup containing the portlet ids.

Threaded Replies Author Date
Hey Minhchau, Welcome to the team! This is an... Michael Young November 3, 2007 5:55 AM
Now updated with pictures! Minhchau Dang November 3, 2007 10:17 PM
Why can I not have my personal public page and... Ivan Wen November 20, 2007 5:29 PM

Hey Minhchau,

Welcome to the team! This is an awesome little tool. To give some background, this little tool basically scrapes your Liferay Portal page for all the portlet id's using Javascript, instead of having to dig through the backend to figure out what's actually on there (database, portlet.xml, etc).

Minhchau, maybe you could post a few screenshots of this in action?
Posted on 11/3/07 5:55 AM.
Now updated with pictures!
Posted on 11/3/07 10:17 PM in reply to Michael Young.
Why can I not have my personal public page and private page?
Posted on 11/20/07 5:29 PM in reply to Michael Young.