0

How to print fields value in views-view.html.twig I have created a views-view.html.twig file for my view slider_3. The template name is 'views-view--slider_3.html.twig' The view formatting is done by this template, but I need a field is come at begging position of the view:

<div class="slider-3-main">{{ rows.required_field }} <div{{ attributes.addClass(classes) }}> {{ title_prefix }} {% if title %} {{ title }} {% endif %} {{ title_suffix }}

How can be the field will written to display at {{ rows.required_field }}

0

1 Answer 1

2

To get a field value of the first result row view.result[0] use the method EntityField::getValue of the view field:

{{ view.field.field_example.getvalue(view.result[0]) }} 
1

Your Answer

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