Hallo you out there.
I have the following problem:
I have a content-type "gallery" with several ckk-fields, and most important: ckk image-fields which are multiple value (for galleries and slideshows).
With that content-type i have created some articles and its all okay.
But now I really want to have a page (lets call it "glance") which shows the title and JUST ONE (the first) image of every article i made with that content type.
I already have embeded a view in glance so every article´s title and ALL :( its images are shown.
But i just want one ! How can I manage this ? I just work with images out of imagefield no image-nodes or something like that....
Pleeease help this young man from Berlin/Germany ;)
Comments
Hello Young Man from Germany
Hello Young Man from Germany ;)
I've had a similar problem and I've decided to redesign my content type. Now I have two image fields in the user form.
1) Image1 (multiple values = false) (user is told, that this should be his best pic, because it will be his avatar and will be shown 'outside' his post)
2) Image2 (multiple values = true)
In my view I'm displaying only Image1 fields.
I suppose there's a second option. You can modify the view and force it to display only the first picture. Check out my other post earlier today: http://drupal.org/node/219411
Hope this helps a bit. Greetings from a young man from Warsaw/Poland ;)
Servus vom Bodensee. That's
Servus vom Bodensee.
That's a theming problem -- get the output of "view wizard" and spot the part of the code where the images are sent to screen. Should be a loop foreach...
Follow the view wizards instructions to build a theming function and replace that foreach loop with a single image -- if you only want the first one that's an easy thing...
Norbert
-- form follows function
Norbert
-- form follows function
Thx !
Ja mei !
Althought its a shame for an franconian-born man to get help from a bavarian....
.... i will check this second option out tomorrow. Didnt use the theme wizard yet. If i have made it i will post it...
Grüße !
Content Templates (contentplate)
Check out the Content Templates module... http://drupal.org/project/contemplate
You can specify the html for the node body / teaser / RSS with it.
Still not working
I still dont get this thing working.
The problem is that this image_field is multi-value, and i dont have access from views on it. You just can control which field shall be shown. Ant this is multivalue, so all pics are in it.
So neither contemplate nor theme wizard could solve that problem.
I now work with GLOBALS which is not a apropriate way i think...
'nother try
Servus, Franke!
First of all: I'm from Styria, but living in Vorarlberg -- so don't worry about Bavarians helping you :)
OK, to your problem...
I made a cck field 'newsphoto' which is a multivalue image field. The code to display all those images is:
All you have to do is:
a.) make a file holding the code for that node (f.e. image_node.tpl.php - be sure you understand how to create names for tpl.php files and where to put them!)
b.) put the code for that very node into that file (by copying the stuff from views wizard or contemplate)
c.) change that foreach loop like that above to something like
That should do what you need...
Norbert
-- form follows function
Norbert
-- form follows function
THX. I surely will need this
THX.
I surely will need this later.
I found out how to just use views for the thing i need..
But thank you very much !
did you ever figure this
did you ever figure this out?
i have the same problem
Yes, by just using
Yes, by just using views:
View type: list
Nodes per page: 0
At fields, add the [field_yourimage] you need and set the handler on "do not group multiple values"
At filters add the node type you want and add the filter node:distinct (!!)
Thanks! You saved me hours
of fildding by sharing this :)