<?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 Web Content Structure image values inside an ADT</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113196141" />
  <subtitle>Get Web Content Structure image values inside an ADT</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113196141</id>
  <updated>2026-04-07T12:55:08Z</updated>
  <dc:date>2026-04-07T12:55:08Z</dc:date>
  <entry>
    <title>RE: Get Web Content Structure image values inside an ADT</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113215162" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113215162</id>
    <updated>2019-04-14T07:54:01Z</updated>
    <published>2019-04-14T07:54:01Z</published>
    <summary type="html">I guess, the easiest way is to use eval. Try this:&lt;br /&gt;&amp;lt;#assign &lt;br /&gt;   data = posterImage?eval &lt;br /&gt;   fileEntryId = data.fileEntryId&lt;br /&gt;/&amp;gt;</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-04-14T07:54:01Z</dc:date>
  </entry>
  <entry>
    <title>Get Web Content Structure image values inside an ADT</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113196140" />
    <author>
      <name>Aaron Falls</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113196140</id>
    <updated>2019-04-12T17:57:53Z</updated>
    <published>2019-04-12T17:57:53Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I am making an Application Display Template that shows different types of Web Content Articles (different Structures). All of the Structures have a field called "PosterImage" (image type).&lt;br&gt;&lt;br&gt;I am able to get a reference to the image with code like this in the ADT:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;#assign
&amp;amp;nbsp; className = assetRenderer.getClassName()
&amp;amp;nbsp; article = assetRenderer.getArticle()
&amp;amp;nbsp; document = saxReaderUtil.read(article.getContent())
&amp;amp;nbsp; rootElement = document.getRootElement()
/&amp;amp;gt;

&amp;amp;lt;#list rootElement.elements() as dynamicElement&amp;amp;gt;
&amp;amp;nbsp; &amp;amp;lt;#if "PosterImage" == dynamicElement.attributeValue("name")&amp;amp;gt;
&amp;amp;nbsp;   &amp;amp;lt;#assign posterImage = dynamicElement.element("dynamic-content").getData() /&amp;amp;gt;
  &amp;lt;!--#if--&amp;gt;
&amp;lt;!--#list--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;The value of posterImage looks like key/value pairs:&lt;br&gt;&lt;pre&gt;&lt;code&gt;{"groupId":"20126","name":"handshake_0.jpg","alt":"","resourcePrimeKey":"","title":"handshake_0.jpg","type":"journal","uuid":"f02ca676-f6ed-471a-a56c-e9d083b010ac","fileEntryId":"142301","resourcePrimKey":"142311"}&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;But it seems to be a string (posterImage?is_string?c outputs true, posterImage?is_hash?c outputs false). How can I get these as discrete values, to assign them to Freemarker variables? In this case, I am only interested in the fileEntryId value.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Aaron Falls</dc:creator>
    <dc:date>2019-04-12T17:57:53Z</dc:date>
  </entry>
</feed>
