K
K
Kirill2018-01-25 10:52:53
Drupal
Kirill, 2018-01-25 10:52:53

How to programmatically display fields from views?

Hey! help with advice, what's wrong with the output of the field?
There are Views, taxonomy/term/... with node output, overridden the html.twig template and you need to display the contents of the number field in the template, each node has different values, I do this:

{% for row in rows %}
   {{ view.field.field_object_label_y.original_value }}
  {% endfor %}

but the same value is displayed, that is, the same number, the same number of times as the number of nodes,
I am not strong in php, tell me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asantat, 2018-01-29
@asantat

It seems to me that if each node has different values, then you need to loop through the nodes, and display the field value in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question