public
Last active

setting look and feel settings on a non-instancable portlet embedded in the theme

  • Download Gist
freemarker.ftl
1 2 3 4 5 6 7 8 9 10 11
<#assign locPortletId = "82" />
 
<#assign PortletPreferencesFactoryUtil = staticUtil["com.liferay.portlet.PortletPreferencesFactoryUtil"] />
<#assign portletSetup = PortletPreferencesFactoryUtil.getLayoutPortletSetup(layout, locPortletId) />
 
<#if portletSetup.getValue("portletSetupShowBorders", "") != "false" >
<#assign temp = portletSetup.setValue("portletSetupShowBorders", "false") />
<#assign temp = portletSetup.store() />
</#if>
 
${theme.runtime(locPortletId, "", "")}
velocity.vm
1 2 3 4 5 6 7 8 9 10 11 12
 
#set ($locPortletId = "82")
 
#set ($PortletPreferencesFactoryUtil = $portal.getClass().forName("com.liferay.portlet.PortletPreferencesFactoryUtil"))
#set ($portletSetup = $PortletPreferencesFactoryUtil.getLayoutPortletSetup($layout, $locPortletId))
 
#if ($portletSetup.getValue("portletSetupShowBorders", "") != "false")
#set ($temp = $portletSetup.setValue("portletSetupShowBorders", "false"))
#set ($temp = $portletSetup.store())
#end
 
${theme.runtime($locPortletId, "", "")}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.