Closed (fixed)
Project:
Imagefield Gallery
Version:
5.x-2.0-alpha4
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2008 at 02:31 UTC
Updated:
4 Oct 2008 at 23:21 UTC
In my teaser template, I would want to write a code for showing just the first pic.
How can I write that.
Please help.
Comments
Comment #1
eclipsegc commentedThe api in the 2.x release has changed a little (function names will be slightly different but I think you can probably make sense of it).
This post outlines how to do that sort of work pretty in-depth. Hope it helps.
http://drupal.org/node/239251#comment-855545
The other option is (since you're using 2.x) you could have an imagefield for lead images and an imagefield for all other images and put two galleries on that content type. That's what I'd suggest, but if you want to do it programmatically, that link describes it fairly well.
Eclipse
Comment #2
michaux commentedHi !
I just tried your solution.
2 imagefields : - field_vos_images (principal image)
- field_galerie_images (Gallery of image)
Teaser template :
print $node->field_vos_images[0]['view']Body template :
print $node->field_galerie_images[0]['view']Nothing work.
My view as the both galleries and the node as the same result.
screen result :
http://www.matinsdunet.fr/?q=view/listeaccessoire
Maybe I'm wrong ????
What do you think ?
Comment #3
eclipsegc commentedOK, let's backup a bit here.
1.) Get rid of your node-type.tpl.php that you're playing with. It is unnecessary.
2.) Under content management -> content types: edit the content type in question, then click the display fields tab up top. There you can specify what should appear in teasers and what shouldn't. Use "default" as the selection, anything else will override imagefield_gallery. Here you can set the display "hidden" for the teaser if you don't want one of your imagefields to show up there.
3.) Finally, set up your galleries and then cck and imagefield_gallery will do all the important work for you.
Comment #4
michaux commentedOh ! you are so cool, you found it.
I make all my website without that.
I never seen it.
Thanks,
Jérôme