AlternateText Image product - ProductName

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 年 前
Hi,

ProductController
Unless otherwise indicated, "AltAttribute" - is assigned to the product name

 
//"alt" attribute
pictureModel.AlternateText = !string.IsNullOrEmpty(picture.AltAttribute) ?                         picture.AltAttribute : string.Format(_localizationService.GetResource("Media.Product.ImageAlternateTextFormat.Details"), model.Name);


How to do: nothing is assigned, if not "AltAttribute"?

Thanks :)
7 年 前
Hi,

What you mean by nothing? I assume, leave it empty, so it would be the trick
 
//"alt" attribute
pictureModel.AlternateText = !string.IsNullOrEmpty(picture.AltAttribute) ?                         picture.AltAttribute : "";
7 年 前
nop4you wrote:
Hi,

What you mean by nothing? I assume, leave it empty, so it would be the trick
 
//"alt" attribute
pictureModel.AlternateText = !string.IsNullOrEmpty(picture.AltAttribute) ?                         picture.AltAttribute : "";


I confide condition per page:

if (!String.IsNullOrEmpty(@picture.AlternateText))
{
code
}


Now always shows that the field is not empty...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.