Close

Is there any option to add Alt text for ribbon images?

nopmstr2014
10 years ago
#8217 Quote
Avatar
  • 35
Hi All,
Is there any option to add Alt text for ribbon images?
Thanks
iliyan.tanev
10 years ago
#8222 Quote
Avatar
  • 347
Hi,

Out of the box, No. 
But you can go to Plugins \ SevenSpikes.Nop.Plugins.ProductRibbons \ Views \ BasePageRibbonHtml.cshtml view and replace it with the following:

@model SevenSpikes.Nop.Plugins.ProductRibbons.Models.BasePageRibbonModel


    @if (!String.IsNullOrEmpty(Model.RibbonPictureModel.PictureUrl))
    {
        <img id="[email protected]@[email protected]" style="@Model.ImageStyle" src="@Model.RibbonPictureModel.PictureUrl" alt="@Model.Text"/>
    }
    else if (!String.IsNullOrEmpty(Model.Text))
    {
        if (String.IsNullOrEmpty(Model.RibbonPictureModel.PictureUrl))
        {
            <label class="ribbon-text" style="@Model.TextStyle">@Model.Text</label>
        }
        else
        {
            <label class="ribbon-image-text" style="@Model.TextStyle">@Model.Text</label>
        }
    }

With this you will be able to use the Text as Alt. This way you will be able to add custom text for your Alt for every ribbon.
Regards,
Iliyan Tanev
Nop-Templates Dev Team
nopmstr2014
10 years ago
#8227 Quote
Avatar
  • 35
Thanks a lot