I am using a View Rendering in my EXM Email Campaign Template.

I saw a recommendation for a hyperlinked image to use this syntax:

@Html.Sitecore().Field("URL", new { text = 
      @Html.Sitecore().Field("Image", new {style = "border:none;", width = "730"})

Which works great apart from the fact if I edit the link it results in the image disappearing from the experience editor window or part of the hyperlink element appears.

If you close and reopen the EXM Experience Editor then it's all fine but it would be a very disconcerting experience for a content author.

enter image description here

enter image description here

enter image description here

After saving and closing and opening up the experience editor: enter image description here

In another View Rendering - very similar markup:

<td align="center">
   @Html.Sitecore().Field("URL", new { text = 
               @Html.Sitecore().Field("ButtonImage", new { style = "border:none;" }) })

After editing the hyperlink I see part of the hyperlink element: enter image description here

Again all fine after I save and close and come back to the editor.

Using Sitecore 9.1.1 and SXA 1.8.1 (have had some buggy behavior with SXA in other aspects of EXM so I'm not sure if this is standard EXM behavior or a bug).

  • 1
    Hey @jen, we saw some similar symptoms when personalizing images on 9.0.x and was resolved with a JS hotfix from support. Not sure if related, but worth running by support. – George Tucker Nov 22 '19 at 7:35

Confirmed this is a Sitecore Bug: public reference number 95437

And workaround provided for my view rendering markup:

@Html.Sitecore().BeginField("URL", new { HideDescription = true, haschildren=true })
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.