By UnicornSong on
I have created a content-type (news story) which has an imagefield.
I now want to create two views -
1. All news stories WITH an image
2. All news stories WITHOUT an image
There is no option to select the cck imagefield within the views "Add filter" selection box.
How do i filter this view on whether the image field has a value in this node or not?
Comments
I've got a similar problem.
I've got a similar problem. I'm using views_bonus/grid to display 3 random images from a CCK node type with an image field attached to it. However, the view is still built even if an image doesn't exist -- so basically, views is not checking if the image field is empty. So sometimes this display can have 1, 2 or 3 images, when ideally, it would always have 3.
There's been a long ongoing discussion about how to modify the views module to check if the particular CCK field image is empty before deciding whether or not to add it to views -- the discussion is here: http://drupal.org/node/101050 -- however no solution yet.
However, maybe a better response is to find a way to expose image fields to views in order to filter them. Oddly enough, the "Image: " fields do appear in the Field options, however, they do not appear in the Filter options below them.
Ideally, one would be able to select the Image field from a drop down list in the filters section, and then have a way to filter out those nodes where the image does not exist (NULL or Empty?).
I'm no expert but maybe something needs to be added to one of the .inc files packaged with the views module?
Any ideas? Thanks!
just thought I'd bump this
just thought I'd bump this in the event an expert out there can help
subscribing
subscribing - no solution yet
subscribe
need this function, too.
http://drupal.org/node/101050#comment-1278152 says:
Someone knows, how? Or does he mean only "standard" CCK fields, but no filefield/imagefield?
yeah - I can't find it
yeah - I can't find it anywhere... Who knows?
I figured this out - for
I figured this out - for those that haven't. In views 2 you create a relationship and select the imagefield (for example) and tick the require this relationship box. This will only show the filtered nodes that include the imagefield.
Works! Thanks!
Wow, nice - it works. Thank you :)
What about - show me all
What about - show me all nodes that DONT have a CCK image attached???
After you've added imagefield
After you've added imagefield as a relationship you'll get new options in filter. Select "file: fid" and filter on that being empty.
only applicable for those
only applicable for those running drupal 6.x -- no solution yet for those running 5.x