<?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>Search Results Template - show image in search results</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120621952" />
  <subtitle>Search Results Template - show image in search results</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120621952</id>
  <updated>2026-04-19T08:04:52Z</updated>
  <dc:date>2026-04-19T08:04:52Z</dc:date>
  <entry>
    <title>RE: Search Results Template - show image in search results</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120693402" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120693402</id>
    <updated>2021-03-24T14:22:00Z</updated>
    <published>2021-03-24T14:22:00Z</published>
    <summary type="html">&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;You may need to fetch the image from article object , you can use
  service locator for fetching the journal article and then use the image .&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;&amp;lt;#assign journalArticleLocalService = serviceLocator.findService(&amp;quot;com.liferay.journal.service.JournalArticleLocalService&amp;quot;) /&amp;gt;

&amp;lt;#if entries?has_content&amp;gt;
	&amp;lt;#list entries as entry&amp;gt;         
	    &amp;lt;img src=&amp;quot;${journalArticleLocalService.getLatestArticle(entry.getClassPK()).getArticleImageURL(themeDisplay)}&amp;quot; /&amp;gt;	
	&amp;lt;/#list&amp;gt;
&amp;lt;/#if&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2021-03-24T14:22:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Search Results Template - show image in search results</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120692994" />
    <author>
      <name>Sushil Patidar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120692994</id>
    <updated>2021-03-23T15:26:18Z</updated>
    <published>2021-03-23T15:26:18Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This is abstract image or structure field?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Sushil&lt;/p&gt;</summary>
    <dc:creator>Sushil Patidar</dc:creator>
    <dc:date>2021-03-23T15:26:18Z</dc:date>
  </entry>
  <entry>
    <title>Search Results Template - show image in search results</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120621951" />
    <author>
      <name>Paweł Kania</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120621951</id>
    <updated>2021-02-19T18:41:23Z</updated>
    <published>2021-02-18T10:38:36Z</published>
    <summary type="html">&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I am using version 7.3.5 GA6.&lt;/p&gt;
&lt;p&gt;I am just creating a custom Widget Template (Search Results Template)
  for search results. I am trying to display an image, but unfortunately
  unsuccessful. I used the code that is already in Liferay, but it
  doesn't work either. Below is the code:&lt;/p&gt;
&lt;div&gt;&amp;lt;div&amp;gt;&lt;br /&gt;    &amp;lt;#if entries?has_content&amp;gt;.&lt;br /&gt;  
   &amp;lt;#list entries as entry&amp;gt;.&lt;br /&gt;             &amp;lt;div&amp;gt;&lt;br /&gt; 
                ${entry.getThumbnailURLString()}&lt;br /&gt;           
  &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/#list&amp;gt;&lt;br /&gt;&amp;lt;/#if&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;p&gt;Web content contains an image in the &amp;quot;FEATURED IMAGE&amp;quot;
  section. What exactly do I need to do to make the image appear in the
  search results?&lt;/p&gt;</summary>
    <dc:creator>Paweł Kania</dc:creator>
    <dc:date>2021-02-18T10:38:36Z</dc:date>
  </entry>
</feed>
