RE: Set ADT Portlet Run time.

Emilio Sánchez, modified 7 Years ago. New Member Posts: 10 Join Date: 10/30/18 Recent Posts
Hi All,


I'm trying to set the ADT to one portlet in code runtime.

In 'portal_normal.ftl' I'm doing this:

<#assign VOID = freeMarkerPortletPreferences.setValue("displayStyle", "ddmTemplate_ADTKEY") />
 <@liferay_portlet["runtime"]
                defaultPreferences="${freeMarkerPortletPreferences}"
                portletName="com_liferay_site_navigation_menu_web_portlet_SiteNavigationMenuPortlet"
            />
  <#assign VOID = freeMarkerPortletPreferences.reset() />

But this isn't working, even if my ADT is default like  this:

​​​​​​​<#assign VOID = freeMarkerPortletPreferences.setValue("displayStyle", "ddmTemplate_navbar-blank-justified-ftl") />

I have been seeing other post and none works.

Anyone knows how to solve this? Any other way to do it through code?

Thank you.
thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Emilio Sánchez

I'm trying to set the ADT to one portlet in code runtime.

Once a PortletPreferences entry exists in the database, the runtime tag won't do anything to update those preferences. You'll need to constantly delete and re-create the sites, or you'll need to write something else to update the preferences.
Emilio Sánchez, modified 7 Years ago. New Member Posts: 10 Join Date: 10/30/18 Recent Posts
Yes, I am using it on a site that is created and destroyed continuously because it uses resources importer. So it should work.

In fact, if instead of changing the 'displayStyle' I modify the 'decorators' it works perfectly.