SaaS CMS has officially launched! Learn more now.

Images with in Editorial block doesn't take alt text value from Image file.


Each image file is associate with fields Alternative text and Copyright text. Even though alternative text value is specified for image file, when it is added within editorial block it doesn't take alt text value from image file, but it takes it value from image description field within insert / edit image widget we have in rich text editor. Can anybody help me with this behaviour of Episerver editorial block?

Feb 11, 2019 13:18

It all depends on the logic of the block. As Episerver doesn't ship with any out of the box blocks, are you using Alloy or a demo site as base package. Where does this Editorial block come from?

Feb 11, 2019 13:33

Editorial block is in Shared block as it is in Alloy demo website. This is view for Editorial block:

@model EditorialBlock

<div class="clearfix" @Html.EditAttributes(x => x.MainBody)>
@Html.DisplayFor(x => Model.MainBody)

Feb 13, 2019 6:50

It seems that when you drag&drop an image to XhtmlString field, image alt. text will be the same as the file name.
But when you insert an image using "Insert edit/image" link, alt. text is empty, and that's what confuses editors.

Feb 13, 2019 14:06

I think the only way to "fix" this is to create your own TinyMCE plugin (basically copy the existing Insert/edit image plugin) and add logic for fetching alternative text from the image file content. Alternative text property is not a built-in property for images. It's custom and the out of the box TinyMCE plugin can't fetch values from properties that's project specific. If the property existed on the abstract ImageData class it would be a different story.

Edited, Feb 13, 2019 15:58
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.