I am wondering if there is a way to limit a view by whether or not a cover image exists in Views. I am using views to generate different views of new materials, and I can select this as a field to display using the "Millennium" category, but this doesn't exist in the filters area. I want to display just book jackets in one area, and without the ability to filter on this, I am getting a lot of empty book jackets --
Comments
Comment #1
janusman commentedThe thing is, teh cover images actually reside on an external server. To acheive what you want, you'd need to add a CCK Image FileField to each item and devise some way (manual? auto?) to populate that field with cover images. Meaning, you'd have to store those cover images locally.
Then you could create a view that shows only nodes that have a file inside that Image FileField.
Comment #2
magibird commentedYes, I figured this was the case... I was hoping you might have other creative ideas about this. I have a php script which can determine whether the image exists or not, and I can make this work as a block, but I haven't quite figured out how to make it work as a views filter -- I'm struggling with Views PHP Filter right now, but I'm not quite there yet... will post if I get it to work, or if you have any other suggestions, they would be appreciated as well!
This module is awesome, by the way -- I am pretty excited to put it into production!
Comment #3
janusman commentedI think you could use THe Computed Field module... which can calculate a view field's values from PHP code... and once it is calculated it can store the value in the database (I'm thinking then you could probably tell views to limit the view to only certain values of that computed field).
If you're more confortable with code you could maybe even add in a CCK text field to your nodes, and store a value that means "image is available" for that node. Of course you'd have to store that value in the database somehow... you could just do a basic
and then use views to filter to nodes that have the text "with-image" in the field my_new_field.
These are all sort of roundabout ways to do it... hope that helps somehow.
Closing this out =)
Comment #4
magibird commentedComputed Field worked beautifully, thanks!
Comment #5
janusman commentedAwesome! Glad to hear it.