Tuesday, 2 July 2013

get custom field (expando table) value in velocity template

Hi all ,

First accessing service of liferay in velocity we have to enable serviceLocator.
You have to right below line to enable to servicLocator in portal-ext.properties file & restart server.

where to find portal-ext.properties click here.


Now in template right below code to get particular user field value..

#set ($UserLocalService = $serviceLocator.findService('com.liferay.portal.service.UserLocalService'))
#set ($companyId = $getterUtil.getLong($request.theme-display.company-id))
#set ($userId = $getterUtil.getLong($request.theme-display.user-id))



It display the value of user degree custom field value.

If any query plz do comment or mail us at: