<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>PortletPreferences in DLPortlet don't work</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120657348" />
  <subtitle>PortletPreferences in DLPortlet don't work</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120657348</id>
  <updated>2026-04-05T10:02:52Z</updated>
  <dc:date>2026-04-05T10:02:52Z</dc:date>
  <entry>
    <title>RE: PortletPreferences in DLPortlet don't work</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123097545" />
    <author>
      <name>Daniel Anthofer</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123097545</id>
    <updated>2024-12-06T17:15:55Z</updated>
    <published>2024-11-27T12:53:55Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;were you able to solve this issue? I am in a similar situation and I
  would be interested in the solution.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;</summary>
    <dc:creator>Daniel Anthofer</dc:creator>
    <dc:date>2024-11-27T12:53:55Z</dc:date>
  </entry>
  <entry>
    <title>PortletPreferences in DLPortlet don't work</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120657347" />
    <author>
      <name>Jordi Martinez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120657347</id>
    <updated>2021-03-02T16:09:58Z</updated>
    <published>2021-03-02T16:07:57Z</published>
    <summary type="html">&lt;p&gt;Hello everyone.&lt;br /&gt;
  &lt;br /&gt;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.&lt;br /&gt;
  &lt;br /&gt;I've made an structure (where we have the accordion title and
  the folder id we want to show), article definition and template.&lt;br /&gt;
  &lt;br /&gt;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.&lt;br /&gt;
  &lt;br /&gt;To do that, I've defined the preference map:&lt;br /&gt;
  &lt;br /&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;&amp;lt;#assign preferencesMap = freeMarkerPortletPreferences.getPreferences({
                    &amp;quot;portletSetupPortletDecoratorId&amp;quot;: &amp;quot;barebone&amp;quot;,
                    &amp;quot;rootFolderId&amp;quot; : &amp;quot;${elem.FolderRoute.getData()}&amp;quot;,
                    &amp;quot;showFoldersSearch&amp;quot; : &amp;quot;false&amp;quot;,
                    &amp;quot;enableRatings&amp;quot; : &amp;quot;false&amp;quot;,
                    &amp;quot;portletSetupUseCustomTitle&amp;quot; : &amp;quot;false&amp;quot;,
}) /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Then, I add this:&lt;br /&gt;
  &lt;br /&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt; &amp;lt;@liferay_portlet[&amp;quot;runtime&amp;quot;]
                           defaultPreferences=&amp;quot;${preferencesMap}&amp;quot;
                           portletProviderAction=portletProviderAction.VIEW
                          portletName=&amp;quot;com_liferay_document_library_web_portlet_DLPortlet&amp;quot;
                       /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;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
  &amp;quot;preferencesMap&amp;quot; variable to only &amp;quot;test&amp;quot; text and
  the code executes with the same results, so seems that the
  portletpreferences are ignored to the DLPortlet.&lt;br /&gt;
  &lt;br /&gt;Do you have any idea of what is happening? Or can you give me an
  alternate solution? (I've also tested with
  &amp;lt;liferay-portlet:runtime&amp;gt; tag, and set the defaultpreferences
  there... but then the portlet didn't show).&lt;br /&gt;
  &lt;br /&gt;Thank you in advance!&lt;/p&gt;</summary>
    <dc:creator>Jordi Martinez</dc:creator>
    <dc:date>2021-03-02T16:07:57Z</dc:date>
  </entry>
</feed>
