How do I return a field value from Views when using a Views Relationship? Im using views-view-fields--pagedisplay--html.twig


seems to return titles but


does not return any vales, however the field exists if I

{{ dsm(fields) }}

I have Twig Tweak & Twig Feld Value modules installed also.

1 Answer 1


Views templates don't work like field templates, so the modules you have installed won't help. Though you can use node and field templates by switching the Format of the View to Content instead of Fields or you can configure a single field to use a field template in STYLE SETTINGS.

If you want to use the views templating system you might consider switching to the format Table, because this template has the most options.

The template you have now has very limited options. The field array is exactly the output you have configured in Views UI and this is the place where you should apply your adjustments.

After all of that, if you still want to see which fields and their content are delivered to your template, then use this loop for debugging:


{% for key, field in fields %}
  <p><i>{{ key }}:</i> {{ field.content }}</p>
{% endfor %}

field.content is finally rendered html, so you can't do much with it. The array keys contain the field names of the fields you have selected and arranged in the FIELDS section of the Views UI. It doesn't matter whether the fields come from relationsships.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.