I have created a view that has many fields including a link field.
I am using a twig template. my view twig name is views-view-fields--dashboard--block_3.html.twig
It works nicely but I need to render a path in an anchor tag. here is my code.
<a href="{{ fields.view_node.content}}">
<div class="mail-contnet">
<h5>{{ fields.title.content }}</h5>
<span class="mail-desc">{{ fields.body.content }}</span>
<span class="time">{{ fields.created.content }}</span>
</div>
</a>
In the anchor tag, I am getting the link but it has twig debugging wrappers. The result is bellow
<a href="
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view_field' -->
<!-- BEGIN OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->
/vanss/ques-curabitur-arcu-erat-accumsan-id-imperdiet-et-0
<!-- END OUTPUT from 'core/modules/views/templates/views-view-field.html.twig' -->
">
and I need only the path. I have already tried the twig_field_value module. but when I {{ fields.view_node.content|field_value}}
Error: Cannot use object of type Drupal\Core\Render\Markup as array in Drupal\twig_field_value\Twig\Extension\FieldValueExtension->isFieldRenderArray() (line 171 of modules\contrib\twig_field_value\src\Twig\Extension\FieldValueExtension.php).
Now I am looking for how to render the value of an anchor tag without any wrapper.