Monday, 30 May 2011

Including a portlet in a theme

Sometimes it is required that we embed a portlet in a theme. We can embed a portlet in a theme through a Velocity template, say, portal_normal.vm.

The embedded portlet usually display a small amount of content. It may be intended for a login screen, for example. It may also be used to display some custom dynamic content. We can use the following steps to add a portlet to a theme:
1. Create a Embed portlet and deploy it.
2. In the portal_normal.vm file of the Noir theme add the following
Velocity code:

   Note : Portlet name you can find by clicking on Configuration -> Sharing -> Anywebsite3. Re-deploy the Noir theme and refresh the page. The embedded portlet shows with borders.
4. Click on the configuration icon of the Embed portlet. Click on Look and Feel.
5. Uncheck Show Borders and click on Save.
6. Close Look and Feel and refresh the page – the portlet borders are gone.
You can see This is the Embed portlet in the screenshot above, which is the text displayed by the Embed portlet.
You can also use the following configuration in ${PLUGINS_SDK_HOME}/themes/embed-portlet/docroot/WEB-INF/portlet.xml to turn off the borders:
You can even embed multiple portlets in a theme.


  1. again.......well written..!!!!

  2. You can follow the below link.

  3. Nice tutorial!
    I have make some new liferay theme, you can download free at

  4. Nice woork i was looking for somthing like this clean and simple.

  5. Mấy bạn có thể chỉ mình cách tạo footer không. cảm ơn các bạn

  6. Mấy bạn có thể chỉ mình cách tạo footer không. cảm ơn các bạn

  7. thank you :). straight and easy