Share

Embedding a portlet in a Theme

We have seen already one use case which is Navigation Portlet for embedding a portlet in a theme.I am just taking one sample portlet which is going to embed in a theme.Some of the other use cases are embedding the QuickLinks and Assets

Steps to Embed

1. Create one portlet which is to be embed in a theme(ThemeEmbeded-portlet)
2. Deploy the portlet
3. Open portal_normal.vm under docroot/_diffs/templates which is in our custom theme GreenTheme
4. Add the following code to the portal_normal.vm
............. .............
#set ($portlet_id="ThemeEmbedded_WAR_ThemeEmbeddedportlet") $theme.runtime($portlet_id, '', $velocityPortletPreferences.toString())
............. .............
$portlet_id is velocity variable and i assigned a embed portletId to this variable
$theme is a run time variable available in velocity template
runtime is a function
5.Re-Deploy the theme and refresh the page then you can see the portlet

No comments:

Post a Comment