I'm running Liferay 6.2 GA2. Created a Web Content with a dummy Structure and Template with the following source.
#set($layoutServiceUtil = $serviceLocator.findService("com.liferay.portal.service.LayoutService"))
#set($topPublicLayouts = $layoutServiceUtil.getLayouts($groupId,true))
#set($viewCountExpName = 'viewCount')
#set($viewCount = ${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)})
Works in Chrome-${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)}-
-${topPublicLayouts.get(0).getNameCurrentValue()}-
--${viewCount}--
Created the custom attribute, removed the Velocity restrictions from the portal-ext.properties.
The above code works in Chrome but doesn't work in IE.
Response in Chrome:
Works in Chrome-1617- -Home- --1617--
Response in IE (8,9,10 & 11):
Works in Chrome-${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)}- -Home- --${viewCount}--
Debug on the Velocity Packages give me the below error logs only for IE:
17:41:45,687 DEBUG [RuntimePageImpl-6][velocity:155] Null reference [template '10257#10297#12641', line 5, column 17] : ${topPublicLayouts.get(0).getExpandoBridge().getAttribute($viewCountExpName)} cannot be resolved.
17:41:45,688 DEBUG [RuntimePageImpl-6][velocity:155] Null reference [template '10257#10297#12641', line 7, column 3] : ${viewCount} cannot be resolved.
How can I get the $viewCount
value working in IE browser.