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.

1
  • Are you tried twig debug option.
    – vijay
    Commented Jun 22, 2017 at 6:41

1 Answer 1

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 and acknowledge you have read our privacy policy.

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