0

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>
                    <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="???"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                {% endfor %}
            </div>
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.