Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292732

accessing views row fields inside views-view-unformatted.html.twig

$
0
0

Hi,

I have figured a way to access views views row fields inside views-view-unformatted.html.twig

{% for row in rows %}

  {{ row.content['#view'].style_plugin.render_tokens[ loop.index0 ]['{{ YOUR_FIELD_NAME }}'] }}

{% endfor %}

I need to know what do you think of this method, is it cool or bad.

The reason why I avoid using views-view-fields.html.twig is that I use lots of views with many displays, and I don't wan't to use lots of template overrides.


Viewing all articles
Browse latest Browse all 292732

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>