0

I have tried every suggestion I could find and nothing is working. I need to get the actual path or url since I am adding some specific classes to the link. The array is below

enter image description here

I got to this from the following

{% set link = paragraph.field_link.value.0 %}
{{ kint(link) }}

I understand that I need to use the url() or path() function but these require 2 parameters and I am unsure where to get these from.

1 Answer 1

0

You can try to do like this

{{ content.field_link.0['#url'] }}

That should do it.

This is another possible way of diong it

{{paragraph.field_link.uri }}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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