I am trying to set the alt attribute on the image via imgAttrs option. But the alt attribute, though it is added, remains empty. If I try it with title it does set it correct.
If I try it with the title attribute:
<div afkl-lazy-image="/productimages/{{product.brand.brandNameUrlFriendly + '-' + product.variantId + '-' + product.primaryPictureId}}.jpg?height=329" afkl-lazy-image-options="{'imgAttrs': [{'title':'{{product.brand.brandName + '' + product.variantName}}' }]}" class="afkl-lazy-wrapper afkl-img-ratio-1-1 asp-product--img_legacycorrect"></div>
I am trying to set the alt attribute on the image via imgAttrs option. But the alt attribute, though it is added, remains empty. If I try it with title it does set it correct.
The code:
<div afkl-lazy-image="/productimages/{{product.brand.brandNameUrlFriendly + '-' + product.variantId + '-' + product.primaryPictureId}}.jpg?height=329" afkl-lazy-image-options="{'imgAttrs': [{'alt':'{{product.brand.brandName + '' + product.variantName}}' }]}" class="afkl-lazy-wrapper afkl-img-ratio-1-1 asp-product--img_legacycorrect"></div>
Produces:
<div afkl-lazy-image="/productimages/off-white-omlb002s161120360210-29962-28316.jpg?height=329" afkl-lazy-image-options="{'imgAttrs': [{'alt':'Off WhiteOMLB002S161120360210' }]}" class="afkl-lazy-wrapper afkl-img-ratio-1-1 asp-product--img_legacycorrect" afkl-lazy-image-loaded="done"><img alt="" class="afkl-lazy-image" src="/productimages/off-white-omlb002s161120360210-29962-28316.jpg?height=329"></div>
The alt attribute is left empty.
If I try it with the title attribute:
<div afkl-lazy-image="/productimages/{{product.brand.brandNameUrlFriendly + '-' + product.variantId + '-' + product.primaryPictureId}}.jpg?height=329" afkl-lazy-image-options="{'imgAttrs': [{'title':'{{product.brand.brandName + '' + product.variantName}}' }]}" class="afkl-lazy-wrapper afkl-img-ratio-1-1 asp-product--img_legacycorrect"></div>
Produces:
<div afkl-lazy-image="/productimages/off-white-omlb002s161120360210-29962-28316.jpg?height=329" afkl-lazy-image-options="{'imgAttrs': [{'title':'Off WhiteOMLB002S161120360210' }]}" class="afkl-lazy-wrapper afkl-img-ratio-1-1 asp-product--img_legacycorrect" afkl-lazy-image-loaded="done"><img alt="" title="Off WhiteOMLB002S161120360210" class="afkl-lazy-image" src="/productimages/off-white-omlb002s161120360210-29962-28316.jpg?height=329"></div>
The title attribute is correct, but teher is also an alt but still empty.
Am I missing something here? Thanks for the help.