Hello,

I have a CCK node type set up with an imagefield widget/field which is not a required field, I've also set up a view but I want to filter on nodes which have an image/value. I'm looking in the filter section and I cannot see how to do this anywhere? Has any one any pointers where to start/ideas?

I'm currently using the folling versions of the modules, should that help,

Views - 6.x-2.1
CCK - 6.x-2.0-rc10
Imagefield - 6.x-3.0-alpha2
FileField - 6.x-3.0-alpha5

If this is posted in the wrong queue maybe the imagefield one let me know and I'll post there too.

Cheers
Rich

Comments

yched’s picture

From the Views issue submission guidelines :

"f you only read one of these submission guidelines, read this one. (Then please read the rest) If your problem deals exclusively with fields or filters provided by another module (CCK, Image, VotingAPI are common) please post the issue under the queue for that module first; all modules are responsible for telling Views about their own fields. It's possible Views IS at fault, but the module maintainers are the best people to make that determination, and they can kick the issue into the Views queue with an explanation of what's wrong if that is the case."

Please take the time to read those and comply. Might seem of little importance to you, but quickly gets really annoying for maintainers of modules with such huge issue queues as Views or CCK...

This is primarily an issue for Imagefield / Filefield (which imagefield relies on)
CCK default views integration provides a filter for fields which lets you pick 'Is empty / is not empty' options. However, filefield chooses to remove it and to provide no filter.

Bumping to filefield queue.

yched’s picture

Project: Views (for Drupal 7) » FileField
Version: 6.x-2.1 » 6.x-3.x-dev
Component: User interface » Code

Doh, failed to actually move the issue.

oliveyrc’s picture

Project: FileField » Views (for Drupal 7)
Version: 6.x-3.x-dev » 6.x-2.1
Component: Code » User interface

Sorry my bad on that one, I'll re post in the correct queue

Rich

oliveyrc’s picture

Project: Views (for Drupal 7) » FileField
Version: 6.x-2.1 » 6.x-3.x-dev

Sorry, looks like we both posted at the same time, well started and moved back into views, changing now

dopry’s picture

Status: Active » Postponed (maintainer needs more info)

@yched: I chose to remove it? Where? Did I overlook something? I'm pretty sure I implemented the content_empty code....

drewish’s picture

Status: Postponed (maintainer needs more info) » Fixed

you need to add a relationship for the file or imagefield that you're interested in then add a filter for the file id field and specify the relationship you just created for your field.

Status: Fixed » Closed (fixed)

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

vthirteen’s picture

expanding a little bit comment #7 @drewish:

to get the desired result, use a relationship for the filefield you want to filter nodes by, let's call it filefield "A" (for instance: "display/don't display nodes with empty filefield A").
make the relationship "required".
as for filters, just filter for the type of node which has that filefield or any other filter you might need, just don't filter again by the same filefield A, you don't need that and it might cause unexpected results.