How can I make my table view with exposed filters default to instead of defaulting to the first choice Thus allowing someone to instantly see everything and then filter if they choose to. Maybe I'm just not seeing the option, but have been playing with it for some time.

Thanks in Advanced!!!!!

BTW

I love views....

Comments

goldenduck’s picture

Should say: "...default to any instead of..." Sorry bout that.

merlinofchaos’s picture

Make sure you have no items selected and it should default to any.

goldenduck’s picture

Thanks Magical Merlin, after remaking the view it works fine, idk what i was doing wrong, thanks for the help!!

- Clark

mnasgowitz’s picture

I had the same problem... thanks for the help!

mnasgowitz’s picture

Status: Active » Fixed

Since merlinofchaos help solved the problem we might as well close this issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

SeanA’s picture

Title: Exposed filter selection defualt to <any>? » Exposed filter selection default to <any>?

I had the same problem, but selecting no items didn't make -Any- the default. I had to delete the Taxonomy: Term filter from the view entirely, and then add it back in again, to get it working properly.

capellic’s picture

I'm going to suggest that this be looked at is a UX bug. The reason I suggest this is a UX bug is because, when you click on the "Expose" button, Views checks all of the terms in the vocabulary, suggesting that "this is the way it should be." The field label from that area says, "Select terms from vocabulary Event Category" which I interpreted as, "select the ones you want to show up in the select list," especially because Views selects them all be default.

And then I go and uncheck all the taxonomy terms as suggested, update and then preview. Now I am getting an illegal selection error, but the good news is that "" is selected. Then I go back to edit the filter and all of the terms are checked again -- unchecked them doesn't seem to do any good.

Then, on a fluke, I checked, "Limit list to selected items", update and preview. It works!

Call me dense, but this just seem so intuitive to me. ;-)

Thanks for all your work on this module -- amazing stuff.

capellic’s picture

Category: support » task
Status: Closed (fixed) » Active
merlinofchaos’s picture

I don't understand what you want changed. This is not a simple set of behaviors to change, either. Changing something can have ripple effects, so I am very wary of changes to this.

capellic’s picture

Given the complexity, I think it would be best to simply update the field description text to indicate that "Limit list to selected items" must be checked in order to use the optional checkbox ()? The code doesn't necessarily need to change, just a bit more hand-holding?

AntiNSA’s picture

Im not useing check boxes, Im using the scrolling list... and there is no any option. If you know how to get Any to be an option I would appreciate it.

KerriO’s picture

StatusFileSize
new82.07 KB

I'm having similar issues. Also, like AntiNSA, I don't have check boxes. I have a scrolling list. I have a very simple exposed taxonomy filter with three years in descending order: 2009, 2008, 2007. No matter what I do, the filter will only default to 2008.

I also don't know how to even *have* any option for "", though at some point I seem to recall that I did. I really need the default filter to be the top option ("2009"). I've tried everything—selecting no option, selecting "2009", deleting and re-creating the filter, and no matter what I do, as long as I enable an exposed filter, it defaults to showing "2008".

I've attached a screenshot of what I'm working with.

dawehner’s picture

Category: task » support

If you really need it you could also hook_form_alter the views_exposed_form.

greta_drupal’s picture

I, too, am looking for a solution to same issue. I have CCK fields of checkbox type, and when exposed, they show the -Any- option. However, the CCK fields of select list type (with allowed values), default to the first item in the allowed values listc. In both instances, the CCK field is configured with a default setting of -None-.

In Views, I have highligted all of the allowed values, and enabled "optional" + "force single" + "limit list to selected items". My expectation is that the "optional" value dictates the -Any- default option.

Ideally, I'd like multiselect for a few of my fields, but the issue of requiring the user to toggle all selections to effectuate a 'reset' seems the less desirable approach. (A form reset button would be a great addition to Views!)

Drupal 6.15
CCK 6.x-2.6
Views 6.x-2.8

[Love, love, love Views. Keep up the good work, MerlinOfChaos!]

Greta

greta_drupal’s picture

I jiggled it a little and it is now working as expected. (Gave it a good night's rest, too.) I'll step lightly and hope it holds.

[Translation: Edited the exposed fields and just reconfigured the same settings, and saved again.]

avibrazil@gmail.com’s picture

Version: 6.x-2.2 » 6.x-2.8
StatusFileSize
new22.51 KB

This is definitively some kind of bug maybe related to the UI, maybe to the query. I don't know.

I have several exposed taxonomy filters similar to the attached image. I want the initial URL (the one that won't filter and show all content) to be short and clean but I get a very generic error saying to contact the administrator.

It only works if the initial URL explicitly has "displayurl?industry=All&other_identifier=All&....." (for the case of the attached example).

I also noticed that "" only appears in the pulldown widget - when 'Force Single' switch is selected -, not in the select list.

On the select list, the "" functionality can only be simulated (without tweaking the URL) selecting all items. This would make very long initial URLs to bookmark, and from there will force users to unselect what they doesn't want instead of selecting what they want. I believe a more intuitive way would be "<Any>" equals to all unselected, but I'm not sure about that. At least this would work for my case.

Also, the image shows all items selected on the admin interface. I didn't select them manually and I understand that selection only makes sense when 'Limit list to selected items' is also checked. If I create a new term in the example vocabulary it will appear unselected. I'm not sure what is the effect but this seems at least visually inconsistent. It means that every time a new term is created I have to reedit my views and manually select the new terms.

esmerel’s picture

Status: Active » Closed (cannot reproduce)

no activity for 6 months

hedac’s picture

I have a different problem with the Any word. It is just that I cannot translate it.. It always says in English.

hedac’s picture

solved changing old_any to t('- Any -') in line 469 of views_handler_filter.inc
I'm sure is not the way to fix it.. but.. I don't need the "old any"... why old any not translated?

avibrazil@gmail.com’s picture

StatusFileSize
new74.67 KB

This is a UX bug also related to Better Select module that converts your taxonomy terms selection list into a list of checkboxes.

The trick is to configure Better Select to act only on node forms and on Views interface unselect all terms automatically selected and select Optional below.

Check out this screenshot. Note how no term is selected and that there are no checkboxes from Better Select.

I lived with this bug for a long time and I figured out the solution from some bug report I can't find anymore so I'm reproducing it here.