just can't seem to figure this one out. an unlimited imagefield in node works perfectly, set to a different imagecache preset for teaser, that works perfectly too - in fact, the whole thing is working great
...but when there are three images in the field on the node, all three flow through to teaser..
any simple way to control so it's 'first image only'?
Comments
Comment #1
idflorin commentedYou can try something like
<?php print $node->field_article_image[0]['view'] ?>I'm ussing this code but for drupal 5 on Haute Fashion.Comment #2
zilla commentedwhere would this go? and i'm assuming that i must change that field_article_image to my own field name, right?
what does 'view' point to?
Comment #3
idflorin commented-You need to create a custom node-story.tpl.php.
something like
-setup field_story_image (in your case your field name).
-view point to whatever you are setting up in display settings -> admin/content/types/story/display
Comment #4
idflorin commentedI think that way the preview function don't work properly, so you need to save to see the results.
Comment #5
zilla commentedthanks. i'm sort of doing this right now with content template (trying to do it anyways, but it feels like it has conflict with a content type that also uses cck in fieldgroups!!)
Comment #6
freeman-1 commentedA simple workaround is to use two CCK/Imagefield fields. One ("first photo" or "main photo") is set to just 1 'value'. The other ("more photos") is set to unlimited or some other number in the drop-down that you want to limit to.
Then controlling the appearance in teasers/full views can done simply via the "Display Fields" tab in Admin/Content-Type/. You can hide "more photos" field or even set them to thumbnail displays below a larger "main photo".
Comment #7
zilla commented@freeman -that's exactly what i'm doing for one of my content types - and use that same principle to move 'main image' above the story, and 'rest of pics' below...but for a few other content types,i thought that i'd avoid asking users to deal with two image fields...
Comment #8
portait commentedI am trying the same with the blog content type using content template and I am able actually getting the desired image result but the content teaser just dissapears.
I am using drupal 6. Any help?
Comment #9
sunMarking as duplicate of #381440: Display settings only one or all setting