0

I have a link field type that I'm referencing in a Twig template. I'm using this code:

<div class="outlined">
<a href="{{content.field_3_column_image_link}}">{{content.field_3_column_image}}</a>
</div>

...BUT when I hover over the link I am seeing https://nameofsite/<div>/node/1</div> instead of https://nameofsite/node/1.

Can someone help me figure out why this is happening? Where are these divs coming from?

Thanks! Bryan

1
  • Yes, thank you! {{content.field_3_column_image_link.0}} did the trick and stripped out the divs! Commented Mar 10, 2022 at 3:56

1 Answer 1

1

See the comment from Patrick Kenny; the link he referred me to had the answer: I just had to use this insted: {{content.field_3_column_image_link.0}}.

Apparently the .0 at the end of the filed type name strips out everything but the raw value.

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