<?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>Customizing asset publisher to open links in a new window</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114549170" />
  <subtitle>Customizing asset publisher to open links in a new window</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114549170</id>
  <updated>2026-04-06T05:35:36Z</updated>
  <dc:date>2026-04-06T05:35:36Z</dc:date>
  <entry>
    <title>RE: Customizing asset publisher to open links in a new window</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114564140" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114564140</id>
    <updated>2019-08-01T18:55:05Z</updated>
    <published>2019-08-01T18:55:05Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;&amp;nbsp;You can use the below ftl code for rendering assets and preview url in new tab , In case you need in new window you can use url to open new window in javascript&lt;br&gt;&lt;pre&gt;&lt;code&gt;[code]&amp;amp;lt;#if entries?has_content&amp;amp;gt; 
         &amp;amp;lt;#list entries as curEntry&amp;amp;gt;
    &amp;lt;a href=" ${curEntry.getAssetRenderer().getURLImagePreview(renderRequest)}" target="_blank"&amp;gt;${curEntry.getTitle(locale)}&amp;lt;/a&amp;gt;
       &amp;lt;br&amp;gt;
    
&amp;lt;!--#list--&amp;gt; 
&amp;lt;!--#if--&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-01T18:55:05Z</dc:date>
  </entry>
  <entry>
    <title>Customizing asset publisher to open links in a new window</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114549169" />
    <author>
      <name>John Cressman</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114549169</id>
    <updated>2019-07-31T18:34:59Z</updated>
    <published>2019-07-31T18:34:59Z</published>
    <summary type="html">One of the departments I am building a portal for wants specific documents listed on various pages.  This is easily done using the asset publisher and tags.  However, they want the document to open in a new windows when clicked, instead of opening in context or in another Liferay page.  They want the physical document - say a PDF - to open in a new window.&lt;br /&gt;&lt;br /&gt;I haven&amp;#39;t found a way to do that using the asset publisher configuration itself.  I assume this can be done using some sort of custom display template but I haven&amp;#39;t had any success in finding any examples I can use.&lt;br /&gt;&lt;br /&gt;Does anyone know the best way to do this and if so, can you please point me to some code to use as a basis?&lt;br /&gt;&lt;br /&gt;Thank you!&lt;br /&gt;​​​​​​​</summary>
    <dc:creator>John Cressman</dc:creator>
    <dc:date>2019-07-31T18:34:59Z</dc:date>
  </entry>
</feed>
