Closed (fixed)
Project:
Drupal core
Version:
9.3.x-dev
Component:
theme system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2019 at 00:16 UTC
Updated:
31 Jan 2022 at 17:34 UTC
Jump to comment: Most recent
Comments
Comment #2
gnanagowthaman sankar commentedHi @zenimagine
Here by attached the code. Please let me know for any changes.
Thanks & Regards,
Gnanagowthaman sankar
Comment #3
gnanagowthaman sankar commented{% set foo = '' %}
{% set len = foo | length %}
{% if foo == '' or len == 0 %}
{{ 'empty field' }}
{% else %}
{{ 'not empty field' }}
{% endif %}
Comment #4
chi commentedThe question does not deal with Twig Tweak module.
Comment #5
rohitreddygaddam commentedComment #7
vikashsoni commentedAdd the condition
{% if content.field_first_name %}
{{ content.field_first_name }}
{% else %}
{% endif %}
Comment #10
cilefen commentedI am closing this support request because there have been no recent comments. It looks like a few people have offered answers. Thank you!