Using SXA 1.2 rev. 161216, I am not able to click on an image's external link even when I specified one in it's URL field.
How to enable it ?
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityYou just have to edit the Image.cshtml view and change the following condition,
@if (Model.LinkItem != null && Model.LinkItem.TargetItem != null)
for
@if (Model.LinkItem != null && (Model.LinkItem.TargetItem != null || (!Model.LinkItem.IsInternal && !string.IsNullOrEmpty(Model.LinkItem.TargetUrl))))
as a matter of fact, in case there is an external link, the LinkItem.TargetItem is null and we need to get into this piece of code and in the case there is no specified link, we need to avoid getting in the code because it would render a link to this page (thank you guschti !)
@if (Model.LinkItem != null && (Model.LinkItem.TargetItem != null || (!Model.LinkItem.IsInternal && !string.IsNullOrEmpty(Model.LinkItem.TargetUrl))))