tags:

views:

107

answers:

2

I've set up a view of "properties". One of the fields is "price". Now, i've exposed price in a block, so that you can search for it from the block. The problem is that when you view the block, it shows the field as a box where you can enter a value. What I want is a dropdown, where you can select the following options:

  • < 1 million
  • < 2 million
  • < 3 million

Anyone know how to do that?

+2  A: 

I believe you should be able to use hook_form_alter to change the field into a select field.

ceejayoz
I was hoping for something a bit simpler, that's built in.
RD
There isn't, to my knowledge.
ceejayoz
+1  A: 

The problem is not that you want a select box, it's the level of specialization you want out of the exposed filter. Views can't see what it is you want as options, so it doesn't given you any.

If you wanted to make this functionality configurable from within views (instead of in the CCK Field settings), you would probably want to extend the Views Filter Pack.

However, your easiest option is hook_form_alter, unless the Textfield widget supports "Allowed Values", which I doubt.

Grayside