title: How to display plain HTML of Web Content with Freemarker in LiferayPortal
body: <p>In Liferay Portal 7.2, I have a Dynamic Data List of elements that are Basic Web Contents.
  For each Web Content in this list I want to display a custom HTML template defined in the web content itself.</p>
  
  <p>I have tried</p>
  
  <pre><code>&lt;#assign records = ddlDisplayTemplateHelper.getRecords(reserved_record_set_id)&gt;
  &lt;#if records?has_content&gt;
      &lt;#list records as cur_record&gt;
          ${ddlDisplayTemplateHelper.renderRecordFieldValue
                      (cur_record.getDDMFormFieldValues("WebContent")?first, locale)}
      &lt;/#list&gt;
  &lt;/#if&gt;
  </code></pre>
  
  <p>but it only displays the name of the WebContents.</p>
  
  <p>The code I expect is something like this</p>
  
  <pre><code>&lt;#assign records = ddlDisplayTemplateHelper.getRecords(reserved_record_set_id)&gt;
  &lt;#if records?has_content&gt;
      &lt;#list records as cur_record&gt;
          ${cur_record.getTemplateHTML()}
      &lt;/#list&gt;
  &lt;/#if&gt;
  </code></pre>
  
  <p>where <code>getTemplateHTML()</code> is the method that returns the plain HTML of the Web Content.</p>
  
  <p>How can I do this?
  Thanks</p>
  
  <p>Edit:</p>
  
  <p>The Data List is a list of Basic_Web_Content Data Definition.</p>
  
  <p>This is the Data List --> <a href="https://i.stack.imgur.com/Piwte.png" rel="nofollow noreferrer">Data_List_Image</a></p>
  
  <p>and this is the Basic_Web_Content definition --> <a href="https://i.stack.imgur.com/Vr9hg.png" rel="nofollow noreferrer">Data_Definition_Image</a></p>
  
  <p>Edit 2.:
  I also tried to print each field of all WebContents and not just the first field (using ?first) with this code</p>
  
  <pre><code>&lt;#assign records = ddlDisplayTemplateHelper.getRecords(reserved_record_set_id)&gt;
  &lt;#if records?has_content&gt;
      &lt;#list records as cur_record&gt;
          &lt;#if cur_record.getDDMFormFieldValues("WebContent")?has_content&gt;
              &lt;#list cur_record.getDDMFormFieldValues("WebContent") as cur_field&gt;
                  &lt;#if cur_field?has_content&gt;
                      ${ddlDisplayTemplateHelper.renderRecordFieldValue(cur_field, locale)}&lt;br&gt;
                  &lt;/#if&gt;
              &lt;/#list&gt;
          &lt;/#if&gt;
      &lt;/#list&gt;
  &lt;/#if&gt;
  </code></pre>
  
  <p>But again, this lists only the names of the Web Contents.
  It seems that an attribute of type Web Content saves only its name.. </p>