Skip to main content

Devbit

Hide a view if it yields no results

Displaying a view (a list of content) that has no items can be unnecessary if there is no need for a "no results" option. Views that are being hidden when empty can be useful for rich landing pages that aim to provide lots of relevant, additional recent content teasers to the user. However, there…
The Option in the view

Click here to enable the following option:

The checkbox to hide the view when its empty.

Issue: 

Displaying a view (a list of content) that has no items can be unnecessary if there is no need for a "no results" option. Views that are being hidden when empty can be useful for rich landing pages that aim to provide lots of relevant, additional recent content teasers to the user. However, there might not be enough recent content available at some point. In this case, the views should not be shown as empty, but hidden instead.

Solution: 

The screenshots offer a straightforward Sitebuilding solution to automatically hide the entire view or block if there are no items to display.

Profilfoto Lothar Neumann

Lothar Ferreira Neumann

Junior Drupal Entwickler

Ihre Drupal-Website zukunftssicher machen

Wir prüfen Ihr System und zeigen, was Sie für AI, Wartung und Upgrades brauchen.