Drupal 8/9 verify a field is not empty in the twig template
The built-in method isEmpty can be used to determine if a field is empty (). This code snippet works for all field types, checking if the field exists and if the field is not empty. For example, field_name is a field machine name of content.
Share
share your add link
https%3A%2F%2Fmycode.blog%2Flakshmi%2Fdrupal-89-verify-field-not-empty-twig-template%0A
Share in social
Comments