Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- {% if content.first %} isn’t helping, because the empty field is showing up in there.
- (just with no rendered content;)
- something like “foreach block in content.first, if no block.content exist, don’t print” (edited)
- morbus (they/them) [10:12 AM]
- Solved:
- ```{% if content.first|render|trim is not empty %}```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement