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
PortletPreferences in DLPortlet don't work
Hello everyone.
I need to do a webcontent where the user can add accordions, and
inisde of them, point to a concrete folder in the Documents and Media portlet.
I've made an structure (where we have the accordion title and
the folder id we want to show), article definition and template.
Inside the template, I want to loop all the elements added in
the webcontent, and for each of them, define an accordion entry and
the documents and media portlet with the folder the user set, already opened.
To do that, I've defined the preference map:
<#assign preferencesMap = freeMarkerPortletPreferences.getPreferences({
"portletSetupPortletDecoratorId": "barebone",
"rootFolderId" : "${elem.FolderRoute.getData()}",
"showFoldersSearch" : "false",
"enableRatings" : "false",
"portletSetupUseCustomTitle" : "false",
}) />
Then, I add this:
<@liferay_portlet["runtime"]
defaultPreferences="${preferencesMap}"
portletProviderAction=portletProviderAction.VIEW
portletName="com_liferay_document_library_web_portlet_DLPortlet"
/>
When I launch this, I see the accordions, with the title I've set,
and I also see the DL portlet... but without my preferences (no folder
open, no barebone decoration...). To test, I've also defined the
"preferencesMap" variable to only "test" text and
the code executes with the same results, so seems that the
portletpreferences are ignored to the DLPortlet.
Do you have any idea of what is happening? Or can you give me an
alternate solution? (I've also tested with
<liferay-portlet:runtime> tag, and set the defaultpreferences
there... but then the portlet didn't show).
Thank you in advance!
Hi,
were you able to solve this issue? I am in a similar situation and I would be interested in the solution.
Cheers!
Powered by Liferay™