Thursday 28 August 2014

Liferay include portlet in theme

Configure the below statement in portal_normal.vm file

 #set ($VOID = $velocityPortletPreferences.setValue('portletSetupShowBorders', 'false'))
#set ($portlet_id = 'Mention Your ID here')
#set ($my_portlet_id = "${portlet_id}_INSTANCE_1234")
$theme.runtime($my_portlet_id, "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()

ID Location---->Goto ControPanel->Plugins Configuration->Select your portlet and click->and copy Plugin ID and paste it in place of  'Mention Your ID here'

If you want to call 2 custom portlet or other portlet you need to follow the same steps and change the INSTANCE_1234 to some other number like INSTANCE_5678 something like this

Thursday 21 August 2014

How to display theme images in jsp liferay

<%@taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>

<liferay-theme:defineObjects />
img src="${themeDisplay.getPathThemeImages()}/Add.png"
              
                    (If  images is inside folder)

img src="${themeDisplay.getPathThemeImages()}/folder/Add.png"