Alt tag in blog images

Adiyah Shah asked on September 14, 2017 11:22

Is there a way to add alt tag in blog images in Kentico?

Recent Answers


Prashant Verma answered on September 14, 2017 12:12

Hi Adiyah,

Yes you can add alt tag in blog images writing your custom transformation.

Example

ASCX transformation code

<div class="blog-panel">
    <div class="blog-content">
    <div class="image">
        <a href="<%# GetDocumentUrl() %>" style="display:block;">
            <img src="<%# Yourblogimage %>" alt="<%# EvalText("yourblogtitle", true) %>" />
        </a>
    </div>
    <a href="<%# GetDocumentUrl() %>">
        <span class="ProductTitle textContent">
            <%# EvalText("SKUName", true) %>
        </span>
    </a>   
    </div>
</div> 

Thanks

Happy to help you

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.