It was previously impossible to display attached images in node teasers, because upload_image_nodeapi() only adds images to the node body. The supplied patch fixes that. It checks if we are currently displaying a teaser and if so, the uploaded images are displayed in $node->teaser (not $node->body). The patch also removes the refferences in the $node->files array, so the uploaded images don't count as attachments.
| Comment | File | Size | Author |
|---|---|---|---|
| teaser_0.patch | 1.44 KB | paranojik |
Comments
Comment #1
killes@www.drop.org commentedlooks good, but why do you need the line
+ unset($node->files[$fid]); // unset, so image won't appear as attachment
Comment #2
paranojik commentedThat's needed because otherwise, when displaying the node as a teaser, "x attachments" would show up in node links (also counting images). I think that's not appropriate as upload module should only count "other" files.
Comment #3
killes@www.drop.org commentedadded to the HEAD branch so it will be in a D5 version.
Comment #4
(not verified) commented