I have a specific content type that I am overwriting the template node--contenttype.html.twig.
This conent type has 4 fields.
- Title
- Body
- Image
- Video
I am trying to hide the image field from displaying if VIDEO field has value. Which I am doing by using this code in custom twig template.
{% if node.field_video is not empty %}
{{ content.field_video }}
{% else %}
{{ content.field_image }}
{% endif %}
The only problem is that I get one of the fields printed as needed plus I get both fields shown.
Video filed is displayed, plus I get an image and video shown again. Wherever those fields are positioned in MANAGE DISPLAY.
If I disable the two fields in MANAGE DISPLAY then, nothing shows up at all.
How can this be fixed?