In a page display of a view, I am exposing a field of type "select or other". Users will use this exposed field to limit results of the view. I can't seem to find a way to output a dropdown list of available options for this "select or other" field. Instead, I only get a textbox form element.

Am I missing something?

Comments

danielb’s picture

I can think of 4 completely different ways to interpret what you just said.
Please take the time to explain what you are talking about.

pthanos’s picture

edited issue for clarity.

danielb’s picture

OK I get it now.

Well here's the deal, this module does not integrate with Views at all. I don't really know how that happens, it might be in the Views module for all fields, or it might be in the field module.

This module's widgets attach to the text or numeric fields. So however text or numeric fields behave in Views will be the same whether using the select or other widget or not.

If I had to guess the reason some fields can show a dropdown list is because of special handling in views or in the field module, or perhaps because it picks up on the use of allowed values which this module cannot use.

I don't know if this module can do anything to provide a 'select or other' widget for views exposed filters. I suspect it cannot but I am willing to accept code samples or patches that prove otherwise.

If I was faced with the problem you have I could write a hook_form_FORM_ID_alter() implementation to convert the exposed text field into a select field with my own options supplied. Actually I would just use my module Finder which is a replacement solution for a View with exposed filters.

danielb’s picture

Category: feature » support
Status: Active » Fixed

Again let me draw your attention to the 2nd last paragraph of the previous post if you DO know a solution.

Status: Fixed » Closed (fixed)

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

ptmkenny’s picture

I looked into writing a patch for this to add views support, but as you pointed out it appears to be quite a difficult problem to solve.

Instead, I found a way to implement select or other's functionality using the conditional fields module just for those fields where I need to be able to use exposed filters in views.

For anyone who is trying to do this, in short, add an other option to your existing field (current_field). Then add a new field such as current_field_other and then use the conditional fields module to make this newly created field a dependency of the first that is activated when you select "other."

prston’s picture

ptmkenny: Brilliant, I was just looking for this kind of solution as I want to expose a select or other field! Thanks!

SchwebDesign’s picture

The best way i found to do this was by using Select or other with taxonomy term reference, rather than text field. There's at patch here that allows for that: https://drupal.org/node/1716764#comment-7553097)

This then will allow you to have a select list/drop down of allowed values if exposing this as a filter in a view.

I believe 'converting' your text field input to being taxonomy terms instead is the best solution for this, at least it was for me. (one good way to do that is here: https://drupal.org/node/215472#comment-2086422 )

SchwebDesign’s picture

Issue summary: View changes

Hope this clarifies