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.

CommentFileSizeAuthor
teaser_0.patch1.44 KBparanojik

Comments

killes@www.drop.org’s picture

looks good, but why do you need the line
+ unset($node->files[$fid]); // unset, so image won't appear as attachment

paranojik’s picture

That'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.

killes@www.drop.org’s picture

Status: Needs review » Fixed

added to the HEAD branch so it will be in a D5 version.

Anonymous’s picture

Status: Fixed » Closed (fixed)