2

I have an SXA Image component that is a link, but the title attribute value of the link is the image name.

I want to pass the link description to the title attribute using rendering variants. What i have enter image description here

And the result when hovering with the mouse is: enter image description here

Is the any way of having the link descripton instead of having the image name ?

For example:

enter image description here

enter image description here

Right now the Html result is this:

<div class="component-content">
 <a class="field-image"></a><a title="Image 11" 
  href="https://sitecore.stackexchange.com/questions/2569/how-to-display- 
  linked-items-fields-with-rendering-variants-using-sxa"><img 
  src="/-/media/images/solutions/insurance/insurance-screenshot-create- 
  brilliant-digital-experience-v3.png?     
h=379&amp;la=en&amp;w=472&amp;hash=17057797BD81175CCF876F4C04DC59A6B9216463" 
  alt="" width="472" height="379" data-variantitemid="{E2A5B62B-C38B-4FF6- 
  948C-8243CE9E65AD}" data-variantfieldname="Image" style="margin: 0px 0px">
 </a>
</div>
  • Try to set Alt field on Image. That should do the trick! – Peter Procházka May 29 '19 at 11:26
  • @PeterProcházka filling the Alternative Text field on image didn't made any change – Jorge Pimenta May 29 '19 at 11:31
1

You need to set the Alternate text on the Link field, not the image. The Link Description will set the text of the link if it has text, but you are using an image, so that will replace the text. The Title attribute is set by the Alternate text field:

Set the <code>Alternate text</code> field

|improve this answer|||||
  • That won't work either – Jorge Pimenta Jun 3 '19 at 9:04
  • This is not working , is there a workaround for this ? – SitecoreNoob Nov 12 '19 at 10:46

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.