Unable to add image inside WYSIWYG

Enonic version: 6.10.1
OS: Ubuntu 16.04

Hello

We’ve got an issue with inability to add image inside a WYSIWYG.
Here is how it appears:
Create a part with a config:

<part>
  <display-name>Name</display-name>
  <config>
    <input type="TextLine" name="TITLE">
      <label>Title</label>
      <occurrences minimum="0" maximum="1"/>
    </input>
    <input name="TEXT" type="HtmlArea">
      <label>Text</label>
      <occurrences minimum="1" maximum="1"/>
    </input>
    <input name="START_DATE" type="DateTime">
      <label>Start Date</label>
      <occurrences minimum="0" maximum="1"/>
    </input>
    <input name="STOP_DATE" type="DateTime">
      <label>End Date</label>
      <occurrences minimum="0" maximum="1"/>
    </input>
  </config>
</part>

Add some text and an image to the WYSIWYG. The image will appear correct in a WYSIWYG, but it will not in a template. This is what we get in a template:

<img src="image://c5c0e0e4-e44b-4d3c-841a-b0c79f38e5f7" alt="IMG_3327" style="text-align: justify; width: 100%;">

Thanks!

Your result is the internal image link format in Enonic XP. If you process the HtmlArea content using processHtml() then you should get a working image URL as a result.

processHtml() view function documentation:
http://docs.enonic.com/en/stable/reference/view-functions/processHtml.html

There’s also a processHtml() included with the portal lib if you want to process the HtmlArea inside your controller.
http://repo.enonic.com/public/com/enonic/xp/docs/6.10.1/docs-6.10.1-libdoc.zip!/module-portal.html#.processHtml

3 Likes