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.


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 }}
  • Yes that did work, thanks again. If I had of done {{ kint(content.field_link) }} would this [#url] of been visible?
    – drupalhgy
    Mar 24 '18 at 19:39
  • Yes I think so.
    – user72672
    Mar 24 '18 at 19:39

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.