I am trying to check if the user_picture field is empty using the twig template, but I am not able to do this.
I tried lots of ways:-
{% if node.user_picture.value %} {% if node.user_picture.entity %} {% if content.user_picture.value %} {% if content.user_picture|render.entity %} {% if content.user_picture|render %}
Sample of code:
{% if node.user_picture.value %} <p>User-picture 02</p> {{ user_picture }} {% else %} <p>Anymonus-picture 02</p> <div> <a href="#"><img src="{{base_path}}/WEBSITE/themes/THEME/images/anonymous.jpg" alt=""></a> </div> {% endif %}