"Wrapped If Not Empty" does not work with the default SXA Image component


Description

When using the default Image rendering variant with Wrapped If Not Empty option for the Is link field, the <img> tag is never wrapped with an <a> tag, even when the image does have a link.

Solution

To resolve the issue, upgrade the instance to SXA 10.2.0 or higher.

Alternatively, perform the following steps:

  1. Select /sitecore/content/[your_tenant]/[your_site]/Presentation/Rendering Variants/Image/Default item.
  2. In the section Variant Details, change the value of the Field used as link target field to TargetUrl.