Is there any way to force blocks created by views to display even when there is no result?


In addition to the NO RESULTS BEHAVIOR, if you have a Contextual Filter, make sure that the default value is set when it is not available from the URL. Otherwise the view may be hidden.

For example, I had to update the "User Orders" view provided by Commerce and change the default value to the logged in user, instead of "hide view"

enter image description here

Views has a somewhat hidden feature for setting the behavior when you have no results.

If you edit the view and click on Advanced, you will see some new settings:

enter image description here

Click on add next to NO RESULTS BEHAVIOR. You will then get a modal with a ton of choices. You should be able to use the textarea or markup options to plop in a   This should force the block to not be "empty". You could also set a message, etc.

You can also always show the advanced options if you visit admin/structure/views/settings

I typically always set "Always show the master display" and "Always show advanced display settings". There are some other useful settings on admin/structure/views/settings/advanced

In addition to what @MPD and @andrewtweber said, you can add a header and footer that will appear when there are and are not results for your view.

Header/Footer for views

Tags: Drupal 7 / Views

Similar questions

Drupal: how to see the query when the node is created or any content type is created
I want to know the insert query when the content is created or any node is created. What is a simple example for that? The main purpose of doing this is I want to log the entries when the node is created. So I have created a history content. When the user creates certain type of content, I have inserted his/her details in to the table by using rule...
Is there any way to use SQL Views in Drupal Views
I have some very tricky reports to develop (with multiple subqueries) and it occurred to me that the Data module would be perfect: I can create my complex queries as SQL Views (I know how to do this), then adopt them with Data and use them as ordinary tables in Views. Perfect! Except that although you can adopt a SQL View, it won't show up in Drupa...
Is there a way to force some block caching despite system block caching option is disabled?
In /admin/config/development/performance settings page, my "cache blocks" options is disabled due to "Block caching is inactive because you have enabled modules defining content access restrictions." But I absolutely need to globally cache some blocks (in particular some superfish blocks because they recreates menu items on every page load if not c...
Is there a way to force drush to enable a module and ignore dependencies?
I'm getting exception 'Drupal\Core\Config\UnmetDependenciesException' with messageConfiguration objects (....) provided by cn_migrator have unmet dependenciesin .../core/lib/Drupal/Core/Config/UnmetDependenciesException.php:84 when trying to enable a custom migration module. I've checked the dependencies listed in the YAML files and can't see anyth...
Display suggested search result on search page if search result is empty
There are any way or module to display search result from suggested keyword on search page if search result is empty. just like google search, But result should come from my Apache solr system.
Is there any way to display an image as background?
I have a picture in a field and I want to be displayed in its exact look but as a CSS background... is this even possible? Is there any mechanism how does that?

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.