I am trying to set simplenews in such a way, that would allow me to send only node teasers with read more links. I have copied simplenews-newsletter-body.tpl.php from the module's directory to my theme and trying to output:
print '$node->readmore'.$node->readmore;
print '$node->teaser'.$node->teaser;
print '$teaser'.$teaser;
print '$node->url'.$node->url;
Unfortunately, all variables are empty except $node->readmore, which gives not url, but digit: 1
How should I template simplnews to send only node teasers with read more links?
Comments
Comment #1
yngens commentedOverwriting a theme does not help also. For some reason
outputs empty teaser. And of course I cleared cache. Teaser is simply not available.
Comment #2
Myles McNally commentedI am today trying to do exactly what you want to do.
The reason the teaser is unavailable is line 1598 of simplenews.module.
unset($node->teaser);
Commenting out this line makes the teaser available. The surrounding code is about creating the body of the email message - being new to Drupal customization I am not sure what is going on here - I am sure it is doing something important (but what?). I have no idea why the value of the readmore variable comes back as 1.
The question is - why is the teaser unset, and could the $node variable simply be created with the teaser instead of the full content? My initial attempts break things.
Comment #3
yngens commentedYes, it is always good to find out the reason why certain code was done the way it's done. Besides, I really hope there is a workaround without modifying the code in the module file.
Comment #4
Jane_dev commentedTrying to do something similar here... very surprised as to how little information there is about customizing the content of simplenews newsletters.
Comment #5
simon georges commentedAvailable variables are clearly stated in the template, as they are in other modules. Customising it means you know what you are doing.
If the body of the node is present, the teaser isn't, as it is often the case in Drupal. You may eventually generate it from the body (using node_teaser() function).
Comment #6
codevoice commentedI need a bump on this. Was this resolved by any of your first posters?
Comment #7
estebant commentedGo to the Content type configuration.
In Manage display (having CCK installed), click on Custom display settings, select "Email: HTML".
Now you can configure the fields separatedly from the other displays.
I use mimemail module, I am not sure if you need it to get the "Email: HTML" option.
Comment #8
miro_dietikerQuestion was answered.