0

To check the field I use the following code:

{% if content.field_name|render is empty %}

How to check on node.twig if {{ my_cool_view }} result is empty? Is this generally possible in Drupal 8? Thank you for help.

3

You can use twig_tweak Module, and use drupal_view_result extension like:

{% if drupal_view_result('who_s_new', 'block_1') is empty %}

For more info look at this module Cheat sheet

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.