0

How can I fetch label and link field in views-view-fields--VIEW-NAME-HERE.html.twig file

So far I have tried

{{ fields.field_action_link.content }} give me the anchor tag prebuilt (html)
{{ fields.field_action_link.0.url }}
{{ content.field_action_link[0]['#url'] }}

but none of them seems to work for me. I am able to retrieve all other fields including image field.

  • Are you tried twig debug option. – vijay Jun 22 '17 at 6:41
0

Just edit the Link field and select these two options (highlighted in screenshot)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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