Skip to main content
added 39 characters in body
Source Link

I know how to check if a field is empty in a twig template (example node--lorem.html.twig):

{% if node.field_lorem.value is not empty %} <p>not empty</p> {% else %} <p>empty</p> {% endif %} 

I would like to check if a field is not empty inside a paragraph twig template (example paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_lorem.value is not empty %} 

or

{% if node.field_lorem.value is not empty %} 

I can display this field value like this :

{{ content.field_lorem }} 

I know how to check if a field is empty in a twig template (example node--lorem.html.twig):

{% if node.field_lorem.value %} <p>not empty</p> {% else %} <p>empty</p> {% endif %} 

I would like to check if a field is not empty inside a paragraph twig template (example paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_lorem.value %} 

or

{% if node.field_lorem.value %} 

I can display this field value like this :

{{ content.field_lorem }} 

I know how to check if a field is empty in a twig template (example node--lorem.html.twig):

{% if node.field_lorem.value is not empty %} <p>not empty</p> {% else %} <p>empty</p> {% endif %} 

I would like to check if a field is not empty inside a paragraph twig template (example paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_lorem.value is not empty %} 

or

{% if node.field_lorem.value is not empty %} 

I can display this field value like this :

{{ content.field_lorem }} 
added 122 characters in body
Source Link

I know how to check if a field is empty in a twig template (example node--lorem.html.twig):

{% if node.field_lorem.value %} <p>not empty</p> {% else %} <p>empty</p> {% endif %}  

I would like to check if a paragraph field is not empty inside a paragraph twig template (example paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_lorem.value %} 

or

{% if node.field_lorem.value %} 

I can display this field value like this :

{{ content.field_lorem }} 

I know how to check if a field is empty in a twig template :

{% if node.field_lorem.value %} 

I would like to check if a paragraph field is not empty inside a paragraph twig template (paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_lorem.value %} 

or

{% if node.field_lorem.value %} 

I can display this field value like this :

{{ content.field_lorem }} 

I know how to check if a field is empty in a twig template (example node--lorem.html.twig):

{% if node.field_lorem.value %} <p>not empty</p> {% else %} <p>empty</p> {% endif %}  

I would like to check if a field is not empty inside a paragraph twig template (example paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_lorem.value %} 

or

{% if node.field_lorem.value %} 

I can display this field value like this :

{{ content.field_lorem }} 
added 48 characters in body
Source Link

I know how to check if a field is empty in a twig template :

{% if node.field_lorem.value %} 

I would like to check if a paragraph field is not empty inside a paragraph twig template (paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_datefield_lorem.value %} 

or

{% if node.field_lorem.value %} 

I can display this field value like this :

{{ content.field_datefield_lorem }} 

I know how to check if a field is empty in a twig template :

{% if node.field_lorem.value %} 

I would like to check if a paragraph field is not empty inside a paragraph twig template (paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_date.value %} 

I can display this field value like this :

{{ content.field_date }} 

I know how to check if a field is empty in a twig template :

{% if node.field_lorem.value %} 

I would like to check if a paragraph field is not empty inside a paragraph twig template (paragraph--lorem.html.twig). But this doesn't work :

{% if content.field_lorem.value %} 

or

{% if node.field_lorem.value %} 

I can display this field value like this :

{{ content.field_lorem }} 
Source Link
Loading