When using exposed filters, you get a dropdown box to select the term from. Is it possible to do the same thing with CCK select fields?

After all, the nodes are bound to have data from a pre-defined set (i.e., the select field options), so is there a way to give that information to Views?

In fact, is this a Views issue? Or is it a CCK issue?

How many questions is it possible to put in a support request? Who knows? :)

Comments

merlinofchaos’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.x-dev » 6.x-1.x-dev
Component: User interface » content.module

Indeed, this is a CCK issue; it has to expose that list to Views in order for views to use it. Dunno how hard that is, I haven't kept up with CCK's views API model.

Patrick Nelson’s picture

Category: support » feature

In light of merlin's comment, I'm changing this to a feature request. If someone feels that it should be in CCK as standard and wants to change it to a bug, that's fine by me.

KarenS’s picture

Currently field modules can add filter operators, but there are a number of other filter parameters that would be useful, especially 'list', 'option', and 'handler'. Those would make it possible to create drop-down select lists in views filters out of the option labels or do things like filter by the nodereference node title instead of the nid. Other filter variables that might be needed include 'field', 'list-type', 'value-type', and 'help'.

Also the current handling assumes the operator is an array of operators but it could also be the name of an operator function, so that possibility needs to be considered.

Maybe for maximum flexibility, don't limit the list or predetermine whether the parameter will be a value or an array, just alter content.module to accept whatever filter parameter names and values are passed in by the field module.

Another cck issue that could use this sort of fix is at http://drupal.org/node/60756.

KarenS’s picture

I just figured out there is a proposed patch to do this at http://drupal.org/node/60384, so my patch request is a duplicate. I'll leave the original issue active though because once/if the patch is applied someone still needs to come back and patch the optionswidgets module to create the lists.

KarenS’s picture

Title: In exposed filters make CCK select fields work like taxonomy fields » Show drop-down list of options for cck filters

Changing the description slightly since we want the drop-down list in both the exposed and non-exposed filters. Making this work will depend on the patch at http://drupal.org/node/60384 getting committed.

I'm bumping this issue as a place to discuss/create a patch to make this work.

Patrick Nelson’s picture

OK, I see there are a couple of other posts about this including this one, namely 60384 and 69265.

Unfortunately, these posts make it really confusing for someone who isn't fully "in the loop" on the whole CCK / Views issue, so can I ask a few simple questions:

1) Does either the 4.7 branch or the CVS branch include this functionality yet?

1a) If not, is there a likely date when it will?

1b) If so, which one and is the CVS branch compatible with 4.7?

2) If not, can someone clearly list (for the dumbos among us!) which patches need to be applied in order to test/try/use this proposed functionality?

Sorry for the squeal for help, but this functionality is sorely needed, absolutely brilliant if (when) it works but is also beyond the reach of us mere mortals :)

Regards

Patrick

KarenS’s picture

Patrick, this is probably stuck until the cck maintainer is available again. The first step requires a patch to cck to expand the way that filters are handled. The second step then would involve trying to use that patch and other views capabilities to get the filters working. I'm reluctant to work on the second step until we know for sure that the patch is going to get committed exactly as it has been proposed, and the final solution will possibly require additional patches to be created and applied which can't be done until patches are getting committed again, so I think basically everything is halted for now.

Perhaps someone else has figured out the patches needed to get this working. If so, please chime in!!

moshe weitzman’s picture

the dependency for this issue got committed today - http://drupal.org/node/60384. perhaps karenS can take this when she returns from vacation. anyone else is welcome to jump in too.

JonBob’s picture

Status: Active » Fixed

The views filters have been changed for text.module and number.module to support this.

Anonymous’s picture

Status: Fixed » Closed (fixed)