Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Set ADT Portlet Run time.
Hi All,
I'm trying to set the ADT to one portlet in code runtime.
In 'portal_normal.ftl' I'm doing this:
But this isn't working, even if my ADT is default like this:
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.
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.
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.
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.
In fact, if instead of changing the 'displayStyle' I modify the 'decorators' it works perfectly.