views:

72

answers:

3

In Drupal 6, I have created a view, displayed as a block. My goal is to display some text if the view returns results, and hide it if the view is empty. I am using Header for the text, and this works perfectly except for the requirement to show at least one field. I can't save the view if I don't set any fields for display. Is there a way to get past this, without creating a module or hacking the theme?

+1  A: 

You should be able add a field and check its "exclude from display" checkbox.

Scott Reynen
I actually tried that. If you exclude all fields from display, you can't save the view; you get the same error as if there were no fields to begin with. At the moment I'm getting by picking one field and rewriting the output to be a blank space...
Nicholai
A: 

Do as Scott say, and select for "Row Style" = Node, so Fields will not required anymore...

Nikit
A: 

The user nevets on the Drupal forums gave a great example that helped me solve this. Check out http://drupal.org/node/728336#comment-2659760 for the information.

Nicholai

related questions