Liferay -Include portlet without border in FTL template

Using Liferay 6.2, I needed to dynamically include a portlet in a FTL template using

${theme.runtime(portletId, "", "")}
But I wanted it to have no border.

The doc points to this link but this is valid only for Velocity templates.

Here is the code I used

<#assign portletId= "my_portlet_id" />
<#assign PortletPreferencesFactoryUtil = staticUtil["com.liferay.portlet.PortletPreferencesFactoryUtil"] />
<#assign portletSetup = PortletPreferencesFactoryUtil.getLayoutPortletSetup(layout, portletId) />
<#assign temp = portletSetup.setValue("portletSetupShowBorders", "false") />
<#assign temp = portletSetup.store() />
${theme.runtime(portletId, "", "")}

That comes from that Gist.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s