Posted by joachim on November 23, 2011 at 6:23pm
3 followers
| Project: | Simplenews Scheduler |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
In _simplenews_scheduler_new_edition():
$node = node_build_content($node, FALSE, FALSE);
$content = drupal_render($node->content);The $content variable holds the full rendered content of the node -- but it's never used subsequently!
Comments
#1
Here's a patch for switching user.
#2
Ignore last patch -- I uploaded to the wrong issue sorry.
#3
There was a reason for this with earlier simplenews module where it was required to make something inside of simplenews trigger, but now it may be defunkt
#4
probably not critical
#5
Actually using $content as the body for the new edition node would mean that fields work. One very useful consequence would be that Views can be pulled in with http://drupal.org/project/viewfield rather than the rather less graceful http://drupal.org/project/insert_view (also, more stable module, and safer for content editors to edit the parent newsletter node).
Adding this as an option to parent newsletter nodes would be a useful feature I think.
#6
We're cloning the whole node object in D7 in simplenews_scheduler_clone_node(), so that should take care of the fields without the need to render them. While that function could probably be improved (there is a commented out line about the title there), it shouldn't be necessary, I don't think this code exists in 7.x-1.x.
#7
> We're cloning the whole node object in D7 in simplenews_scheduler_clone_node(), so that should take care of the fields without the need to render them.
That's not going to have the desired effect though.
Things like Views need to be crystallized at the time of sending so that when the sent edition node is looked at on the site months later it looks like what was sent.
Eg, if your newsletter embeds '5 latest blog posts', the edition node should show the 5 latest at the time of sending, and when you look at the node 6 months later it should show the same ones.
That means we may need to add some sort of setting or system to skip some fields from the cloning perhaps?
#8
What we could do is add a special view mode for this, then the node is rendered in that one and the result is written in the body field or something like that. But the body is a field as well... So maybe a configuration that allows to configure into which field the node should be rendered into. If that is set, then we render, otherwise we clone the node object.
We shouldn't render it by default, in our case, the content is different depending on the subscriber, what we're doing is re-generating it based on the newsletter creation date (which is possible in our case, might not be for others).