Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. is there anyway, in twig, to know whether something /would/ render? my case here is that i have a field in a layout builder region… but, the field is empty, so nothing renders. I’d like the region to NOT be printed if the field is empty.
  2. {% if content.first %} isn’t helping, because the empty field is showing up in there.
  3. (just with no rendered content;)
  4. something like “foreach block in content.first, if no block.content exist, don’t print” (edited)
  5.  
  6. morbus (they/them) [10:12 AM]
  7. Solved:
  8.  
  9. ```{% if content.first|render|trim is not empty %}```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement