I needed to load the teaser and image of a few stories into my newsletter via CCK node-reference and the only way to do that was to pass this function the whole node rather than just the body. This would also enable themers to use special newsletter imagecache presets etc.

I think other themers could benefit from this change as well.

Comments

tizzo’s picture

Not sure if my patch properly uploaded.

TBarregren’s picture

It seems that your patch never got uploaded. Could you please upload it again.

tizzo’s picture

Trying this again.

tizzo’s picture

StatusFileSize
new506 bytes

Ok, this is bizarre, I preview my comment and the file is attached. I click post and it's gone. Any suggestions?!

Edit: Apparently it worked this time. Didn't do anything differently. Weird.

tizzo’s picture

StatusFileSize
new1.36 KB

Updated patch. That last one was in the wrong format. Sorry about that.

nicholas_w’s picture

StatusFileSize
new966 bytes

I'm trying to do the same thing, but this solution doesn't work for me. The problem is the nodeapi hook; this stuff is being called by the 'view' operation, and the node->body isn't fully built yet. So here's a patch that switches to the 'alter' operation, so cck and everything else has been fully integrated into the body.

tizzo’s picture

Actually your patch and mine do different things. I was not trying to send the built node/built body to the template layer I was trying send the actual node data object. A nice middle ground may be to send the node object to theme_simplenews_template_mail_content and then using node_view to render the node.

If we pass the whole node object then the CCK fields can be rendered manually in the template.php file where theme_simplenews_template_mail_content is overridden. This allows the themer to send one thing as the email and display another as the teaser and full view of the newsletter issues on the website.

TBarregren’s picture

Assigned: Unassigned » TBarregren
TBarregren’s picture

Status: Needs review » Fixed

Tizzo, thank you for your patch. It worked as a charm. I have committed it.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.