Getting the value of a taxonomy term reference field I have a content type (Movie) with a taxonomy reference (Movie rating) for which can get multiple values. I would like to use the template node--movie.html.twig and get the first value inserted in the taxonomy term.

I tried using the following code, but it doesn't give any value.

{{ content.field_rating['#items'].getValue()|first.value }}


What am I doing wrong? In which way do I reference the taxonomy term value?
You get the first item out of ['#items] with a "0":

{{ content.field_rating['#items'].0 }}


To get a field from the taxonomy term, I would use the node object, because you don't know how the render array in content will change if you configure the view mode differently:

{{ node.field_rating.0.entity.term_field.value }}