Accessing views row fields inside views unformatted twig in Drupal 10

Created on 30 August 2023, over 1 year ago
Updated 27 September 2023, about 1 year ago

I am using the following ways to access views view 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 %}

or

{% for row in rows %}

{{ row.content['#row']._entity.YOUR_FIELD_NAME[0].value }}

{% endfor %}

I output all my content-type values in the custom template for unformatted.html.twig. Here I have a field for inputting the link to a website and I wanted to get that link only in the A href tag. This is not returning the URL. How can I get the URL value only with out any styling?

💬 Support request
Status

Closed: works as designed

Version

10.1

Component
Views 

Last updated 2 days ago

Created by

🇦🇪United Arab Emirates harikris2007

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024