I have a view fields hook that is listing content in twig. From those fields, I am able to retrieve other fields like text.

{{ fields.field_teaser.content }}

I am unable to get the taxonomy terms though. I was trying this. I'm trying to get the term names but everything is coming up blank.

{{ fields.field_tags.content }}

Any help?

  • I figured this out. Turns out I had the wrong field in my view. Search for tags then make sure it appears in the right content type. In my case, it was article. {% set tags = fields.field_tags.content|render|striptags|lower %} {{ tags }} – bb2j3z Dec 8 at 19:41
  • You should just use a view mode to do this and render in a normal twig file, then you wouldn’t have to do this. – Kevin Dec 9 at 0:09

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.