Sometimes it is necessary to get the actual value of a field (not the formatted/rendered one), e.g. to check a boolean for true
or false
.
If I want to get a field value of a node or paragraph inside twig templates (node.html.twig / paragraph.html.twig) I can use node.field_my_boolean.value
respectively paragraph.field_my_boolean.value
.
How do I accomplish this in a media twig template? I've already tried media.field_my_boolean.value
but it does not work.
{{ content.field_my_boolean }}
and you want the raw value without the HTML markup{{ content.field_my_boolean.0 }}
{{ content.field_my_boolean.0 }}
is it showingwahr/flasch
or1/0
?1/0
I get1
or0
. If I set it to ``wahr/falsch` I getwahr
orfalsch
. That's what I mean by "rendered value".