Subscribe Now!

Enter your email address:

Saturday, October 15, 2011

How to Add portlets in Liferay theme Level

For Adding portlet in theme level., If we add portlet in theme it will display once our theme as selected. Here we are taking sign_in portlet.

Step1: Create your own theme and add portal_normal.vm file under /docroot/_diff/templates/portal_normal.vm.

Step2: Paste this code in header tag:

#set ($globCounterOfThemeDynamicPortletId = 1000)
#set ($locPortletId = "58_INSTANCE_" + $globCounterOfThemeDynamicPortletId)
#set ($globCounterOfThemeDynamicPortletId = $globCounterOfThemeDynamicPortletId + 1)
$theme.runtime($locPortletId, "", $velocityPortletPreferences.toString())
(Note: change your portlet Id in this line here we are taking 58 for login portlet., See all Liferay default Portlet Click Here #set ($locPortletId = "58_INSTANCE_" + $globCounterOfThemeDynamicPortletId) )


Step3: Wirte Css for your portlet in Custom.css file under /docroot/_diff/css/custom.css.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...