<?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>Get url files from a folder id from documents and media in ftl template</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121437832" />
  <subtitle>Get url files from a folder id from documents and media in ftl template</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121437832</id>
  <updated>2026-05-07T01:50:56Z</updated>
  <dc:date>2026-05-07T01:50:56Z</dc:date>
  <entry>
    <title>RE: RE: Get url files from a folder id from documents and media in ftl template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121439141" />
    <author>
      <name>Ernesto Melian</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121439141</id>
    <updated>2022-06-06T16:14:44Z</updated>
    <published>2022-06-06T12:44:12Z</published>
    <summary type="html">&lt;p&gt;Thnks for your reply!&lt;/p&gt;</summary>
    <dc:creator>Ernesto Melian</dc:creator>
    <dc:date>2022-06-06T12:44:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Get url files from a folder id from documents and media in ftl template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438914" />
    <author>
      <name>Tanweer Ahmed .</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438914</id>
    <updated>2022-06-11T18:01:40Z</updated>
    <published>2022-06-04T17:15:30Z</published>
    <summary type="html">&lt;p&gt;Hi Ernesto,&lt;/p&gt;
&lt;p&gt;Here is how we are doing it in our freemarker templates.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;&amp;lt;#assign 
    dlAppLocalService = serviceLocator.findService(&amp;quot;com.liferay.document.library.kernel.service.DLAppLocalService&amp;quot;)
    dlFileEntryLocalService = serviceLocator.findService(&amp;quot;com.liferay.document.library.kernel.service.DLFileEntryLocalService&amp;quot;)
	folder = dlAppLocalService.getFolder(themeDisplay.getCompanyGroupId(), 0, &amp;quot;FOLDER-NAME&amp;quot;)
	fileEntries = dlFileEntryLocalService.getFileEntries(themeDisplay.getCompanyGroupId(), folder.getFolderId())
/&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Tanweer Ahmed .</dc:creator>
    <dc:date>2022-06-04T17:15:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: Get url files from a folder id from documents and media in ftl template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438487" />
    <author>
      <name>Ernesto Melian</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438487</id>
    <updated>2022-06-06T16:14:37Z</updated>
    <published>2022-06-03T16:32:07Z</published>
    <summary type="html">&lt;p&gt;I resolved with this code:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-html"&gt;&amp;lt;#if folderId.getData()?has_content&amp;gt;
    &amp;lt;#assign groupId = themeDisplay.getScopeGroupId()/&amp;gt; 
    &amp;lt;#assign dlFileEntry = serviceLocator.findService(&amp;quot;com.liferay.document.library.kernel.service.DLFileEntryLocalService&amp;quot;) /&amp;gt; 
    &amp;lt;#assign files =dlFileEntry.getFileEntries(groupId,folderId.getData()?number) &amp;gt;
        &amp;lt;#list files as item&amp;gt;
            &amp;lt;img src=&amp;quot;${themeDisplay.getPortalURL() + themeDisplay.getPathContext() + &amp;quot;/documents/&amp;quot; + themeDisplay.getScopeGroupId() + &amp;quot;/&amp;quot; + item.getUuid()}&amp;quot;&amp;gt;
                &amp;lt;br&amp;gt;
         &amp;lt;/#list&amp;gt;
&amp;lt;/#if&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hope this get usefull to others.. &lt;/p&gt;</summary>
    <dc:creator>Ernesto Melian</dc:creator>
    <dc:date>2022-06-03T16:32:07Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Get url files from a folder id from documents and media in ftl template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438327" />
    <author>
      <name>Ernesto Melian</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438327</id>
    <updated>2022-06-03T15:18:18Z</updated>
    <published>2022-06-03T12:55:12Z</published>
    <summary type="html">&lt;p&gt;Thks. I´ll look into it.&lt;/p&gt;</summary>
    <dc:creator>Ernesto Melian</dc:creator>
    <dc:date>2022-06-03T12:55:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Get url files from a folder id from documents and media in ftl template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438263" />
    <author>
      <name>Gennaro Lippiello</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121438263</id>
    <updated>2022-06-03T10:55:26Z</updated>
    <published>2022-06-03T10:55:25Z</published>
    <summary type="html">&lt;p&gt;Take a look at method &lt;strong&gt;getFileEntries&lt;/strong&gt; of the DLFileEntryLocalService&lt;/p&gt;</summary>
    <dc:creator>Gennaro Lippiello</dc:creator>
    <dc:date>2022-06-03T10:55:25Z</dc:date>
  </entry>
  <entry>
    <title>Get url files from a folder id from documents and media in ftl template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121437831" />
    <author>
      <name>Ernesto Melian</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121437831</id>
    <updated>2022-06-02T20:05:07Z</updated>
    <published>2022-06-02T18:46:16Z</published>
    <summary type="html">&lt;p&gt;Hi guys&lt;/p&gt;
&lt;p&gt;I´m trying to show every image stored in a folder of my &lt;em&gt;Documents
    and media&lt;/em&gt; library in a freemarker template DXP 7.3.&lt;/p&gt;
&lt;p&gt;So, how can I get every file of that folder? Assuming that in the
  structure for that template I have a text field to put the folderId or
  folderUrl that I want to travel in search of it´s child files.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I would really appreciate any help you can offer me.&lt;/p&gt;</summary>
    <dc:creator>Ernesto Melian</dc:creator>
    <dc:date>2022-06-02T18:46:16Z</dc:date>
  </entry>
</feed>
