Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
setting look and feel settings on a non-instancable portlet embedded in the theme
<#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 = />
${theme.runtime(locPortletId, "", "")}
#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 = $
${theme.runtime($locPortletId, "", "")}

This comment has been minimized.

Copy link

commented Jan 8, 2015

Thank you for the freemarker staticUtil example. It helped me to figure out how to get a reference to com.liferay.portal.service.ServiceContextThreadLocal to extract the http request parameters from the web content template:


This comment has been minimized.

Copy link

commented Nov 5, 2015

Hi Raymond,

How best can i customize a web form portlet embedded inside my theme. Below has my web form code and hooks haven't been of help in customising this portlet.

Kindly, suggest a fix.

set ($locPortletId = "1_WAR_webformportlet_INSTANCE_" + $group_id)

set ($portletPreferencesFactoryUtil = $portal.getClass().forName("com.liferay.portlet.PortletPreferencesFactoryUtil"))

set ($portletSetup = $portletPreferencesFactoryUtil.getLayoutPortletSetup($layout, $locPortletId))

$theme.runtime("$locPortletId", "", $velocityPortletPreferences.toString())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.