By buzz05 on
This is my first installation of drupal and so far this is the only thing i'm having trouble with.
I want to create a block view on my home page that displays an image that I've attached to a node, a title and a link.
When creating my view I add the fields, Node:Title & Node:Link but there is no option for Node:Image?
So my question is how do you include an image in a view?
All the documentation and tutorials i've read seem to skip over this and simply pull out just text.
Drupal 6.4 | Views 2
Comments
Views 2 and Image Attach do not yet do this.
I am craving this functionality as well. Seems that Views 2 and the current Image modules do not provide this.
Some related threads:
http://drupal.org/node/279844
http://drupal.org/node/318238
http://drupal.org/node/220295
lunk_rat is Acquia Certified Grand Master
i'm doing this in a more clumsy way
not sure why it works, but here's what i'm doing:
all d6 btw, using imagecache for presets (e.g. thumbnail, storysize etc)
cck
filefield
imagefield (for cck)
lightbox2 (for fanciness!)
add cck imagefield to content type - disable 'attachments' (that uses upload, i don't want users seeing two options to upload/attach)
in 'manage fields' for this content type, set 'teaser' to 'thumbnail' and body to 'lightbox 2: storysize>original' (makes bigger pic, then it goes full size in modal window etc - also logically groups all images in node with nifty back and forth arrows)
using simpleviews module - this module lets you create a quick and dirty view that works alone or for more editing within the views module, so in this case i'm doing for content type 'story' (has imagefield) and using simpleviews i create a view for page of most recent stories (generates the teasers)
simpleviews also lets you spit out a widget (block) for this same view - that sounds like what you want!
simpleviews autogenerates this page (i named it 'newstories') and wheni go to that page, it spits out teasers with thumbnails as a 'views display' and if i want to do more, like suppress author name or whatever, i go to views module and that simple view appears in my main list from which i simply open and edit to make it more fancy or whatever..
images in drupal are a bit of a nightmare because everybody is doing something different - i've tried ten zillion image approaches and i'm now back to imagefield with imagecache and filefield (that's what enables the image upload, required for imagefield) - no, it doesn't allow for proper inline placement within the story, but for now that's the sacrifice and the inline module may soon support imagefields at which point my final lingering problem will be gone ;)
........................................................................
i love to waste time: http://twitter.com/passingnotes
Solution Found
I ended up using the random image block - doesn't completely fit my needs but will do until attached images are supported in views.
views respects imagecache/imagefield
if you use my approach, you'll see the imagefield/imagecache in the views configuration - but not so sure if you simply attach an image via core upload module and then look for it via views...
........................................................................
i love to waste time: http://twitter.com/passingnotes
Row style: Node
If you set the "row style" as Node in the view settings, then the view will show the teaser, including images if that is enabled in the Image Attach settings of the content type. You can set Display fields you don't want to show in the teaser to hidden (also in the settings of the content type)
Might that be a solution?
We were not totally
We were not totally satisfied with the Random Image Block so we wrote a custom php query to select the image we wanted.
If any one is interested I can post it here.
Ive: Yes that could be a work around as you could hide the text with CSS couldn't you?