{% if content.field_image['#object'] is not empty %}
{% set image_src = file_url(content.field_image['#object'].field_image.entity.fileuri) %}
{% else %}
{% set image_src = 'https://via.placeholder.com/600x400' %}
{% endif %}
Created
March 12, 2024 15:13
-
-
Save syammohanmp/1b358dd90242207f1c5e811993092202 to your computer and use it in GitHub Desktop.
Drupal Twig Cheat Sheet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment