I'm writing a module which allows admins to overwrite the content of the footer in a newsletter settings form. The text is processed by the token module to replace macro's. For using the simplenews token set, the recipient account object must be present. In the current implementation only the node object is passed to theme('simplenews_newsletter_footer'). With this patch the whole context array is passed.

CommentFileSizeAuthor
#1 simplenews-1010124-1.patch1.82 KBskilip

Comments

skilip’s picture

StatusFileSize
new1.82 KB
simon georges’s picture

Status: Active » Needs review

Sounds trivial, but I'm waiting for Miro's review, in case there are some side effects I don't see.

miro_dietiker’s picture

Status: Needs review » Reviewed & tested by the community

I agree with that we also had issues with theming newsletter fragments where missing context.

For the next big step we should rework our theming completely. However this won't happen for 6.x-2.x.

miro_dietiker’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Fixed in cvs.
Needs D7 port.

miro_dietiker’s picture

Assigned: Unassigned » DrupOn

Assigning

DrupOn’s picture

Status: Patch (to be ported) » Fixed

This has already been implemented with the D7 version. The entire context array is already passed to the theme function.

Status: Fixed » Closed (fixed)

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

shark’s picture

Question, in reference to the 6.x-2.x-dev branch.

Is it considered a bug that the $node object is no longer passed to the footer template?

I can write a patch to either update the "Available variables" list in themes/simplenews-newsletter-footer.tpl.php or fix template_preprocess_simplenews_newsletter_footer() so it sticks $node in the theme $variables, but I'm just wondering what the desired behavior is now (should people use $node from the footer template, or use $context['node']?

Thanks.