« Back

How to get themedisplay object and portlet id in wcd velocity template

General Blogs July 27, 2017 By Neha Goyal

#set ($serviceContext = $portal.getClass().forName("com.liferay.portal.service.ServiceContextThreadLocal").getServiceContext())

    #set ($httpServletRequest = $serviceContext.getRequest())

    #set ($objThemeDisplay = $httpServletRequest.getAttribute("LIFERAY_SHARED_THEME_DISPLAY"))

 

$objThemeDisplay.getPortletDisplay().getId()

No comments yet. Be the first.