How to display the alt and title text in drupal twig template? I already enable the alt and title field, but don't know how to print the field.

enter image description here

Here is the code in custom twig template. I want to display it in the image tag.

<div class="s-carousel s-carousel-product">
                {% for row in data.dynamic %}
                    <div class="prd" prd-id="{{row.id}}" prd-title="{{row.variant.product.title}}" prd-buy-now="{{row.uri}}#buynow" prd-learn-more="{{row.uri}}">
                        <div class="con-img-wrapper">
                            <div class="con-img">
                                <div class="img-bg" style="background-image:url({{row.variant.product.bg}});"></div>
                                <div class="con-img-inner">
                                    <img class="img-prd" src="{{row.variant.product.sizes.0.img}}" alt="???"/>
                {% endfor %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.