Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am exposing a filter or two for the user, but I want them to come to the page view and see no results at all before they choose a filter. At present the view shows masses of results. Is there a way to stop any showing by default? Thanks for any help....
Comments
Comment #1
ff1 CreditAttribution: ff1 commentedI suppose it depends what sort of filter you are applying.
I just created and exposed a 'Node: type' filter on the default 'tracker' view. I then selected the option Operator Is not one of and selected all the options for Node type. I then checked Unlock operator and Limit list to selected items. This produced a view with no items initially, but did require the user to change the operator from Is not one of to Is one of before selecting the required node type.
It's not very elegant and a bit hackish, but if you can play with the initial filter settings, you may get a workable result.
Comment #2
edward.peters CreditAttribution: edward.peters commentedThanks for these ideas. A possible workaround, I suppose, but not a user-friendly solution. I am on the lookout for more possible solutions!
Comment #3
tisho-1 CreditAttribution: tisho-1 commentedI'd love to find a user-friendly workaround as well. There should be one because this seems a really common use case of the exposed filters...
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedCurrently, there isn't a way to do this. I recognize the desire for this feature, but it is going to have to wait for the 'next' Views version.
Comment #5
tisho-1 CreditAttribution: tisho-1 commentedHi Merlin,
Thanks for your reply! I found a solution that you provided in another thread, to play with the default values of the filters in order to get no results by default; hopefully I can get such default values to work in my case.
Thanks again!
Comment #6
edward.peters CreditAttribution: edward.peters commented@tisho: can you share your solution, or give the reference to the thread? Thanks!
Comment #7
tisho-1 CreditAttribution: tisho-1 commentedHi Edward,
My bad for not posting where I found the partial solution: http://drupal.org/node/81365#comment-442219
Thanks!
Comment #8
ngstigator CreditAttribution: ngstigator commentedThis was a good solution what worked for me.
http://drupal.org/node/358546
Comment #9
dagmarFinally implemented with the Exposed Form Plugin: Require Input, in views 3.
Comment #10
edward.peters CreditAttribution: edward.peters commentedThis is terrific news. Thanks for all the hard work on it.