Import instagram posts as nodes automatically with the instagram importer module for drupal 8 & 9.


Jun 03, 2019 in Drupal 8, Snippets, Twig

In a node teaser or full view mode it is for front-end purposes needed to know if an image is available. This snippet takes care of it.

{% if not node.field_image.isempty %}
  <div class="logo-region">
    {{ content.field_image }}
{% endif %}