My views block has a Link field named field_link
, attached to a Content Type named products
, and I'm trying access link field values(url and text) separately in views template views-view-unformatted.html.twig
.
Following code gives the formatted html.
{{ row.content['#view'].style_plugin.render_tokens[ loop.index0 ]['{{ field_link }}'] }}
formatted html:
<a href="example.com/product-list" tabindex="-1">View Products</a>
But I want to access the link fields(url and text) value separately. Any help will be appreciated.
I am not able to check row
variable via kint/dump as I am getting PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted