You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly.
Hiding Views Output Until User Input
If you've ever used the drupal views module, chances are at some point you've needed to suppress any output until AFTER the user has made a selection from one of your exposed filters. Views actually DOES make this possible, but it's not exactly self-evident. I'm going to run you through a quick "howto" on this as I'm sure many people have needed it at some point.
As I mentioned above, this is possible but not particularly self-evident. Views has a number of different "global" group items. The most common of these is probably the Random Sort. Within arguments you also have another member of the global group, the global NULL argument. This is basically a way of attaching your own rudimentary argument to a view. Through the use of the default value (as custom php) and custom validation (again through php) you could cook up just about anything.
With our global NULL argument in place, the following settings are about all we need to make this really work:
1.) Provide a default argument
2.) Argument type -> Fixed entry (Leave the default argument field blank as what gets passed is irrelevant to our needs, we simply needed to make it to the next level which is validation
3.) Choose php code as your validator
4.) Check through the $view->exposed_input array. I recommend using devel module's dsm() function here because it will respond on the ajax that view is using (unlike drupal_set_message()).
5.) Set "Action to take if argument does not validate:" to "Display empty text"
You can get as fancy in step 4 as you need, but it's just down to good old php if statements at that point.
I hope this howto helps other people. We've found it rather useful, and since it's sort of arcane, I wanted to share it.
Thanks to Earl Miles (merlinofchaos) for pointing me in the right direction on this one!
dsm() and drupal_set_message()
This is a really minor point, but don't dsm(), dpm(), and dvm() use drupal_set_message() internally? They should all display just fine. Of course, we should still recommend one of Devel's functions just so you can see the entire array structure more easily.
Little Clarification
I'm able to follow everything except for number 4. I do not really understand what I'm supposed to check for and what I'm supposed to do if I find it.
"4. Check through the $view->exposed_input array."
Thanks for the help.
Tim
This solution is really
This solution is really working great for me. Sometimes its really needed to suppress your output until the user made any selection. At such situations this module provides us that facility. Thanks.Motorcycle personal injury attorney
Wow. i am so happy i found
Wow. i am so happy i found this site. I am really confused about how that works, thank you so much for sharing this. I am looking forward to read more of your articles. Keep up the good work.
A very informative site with
A very informative site with a wide range of interesting perspectives. I'll certainly continue to visit it. Well done!
Drupalcon DC Sponsorship
A proud sponsor of Drupalcon DC!

Great solution
I have tried to solve this problem for a while in my sites, great solution
UG