i'm a php newbie and i can't find where this variable is defined. i know i can just remove it entirely from the template file, but it seems best to redefine the text and continue to use the variable. so where do i do that? it's not under the subscription options (where you define the text sent to people who subscribe and unsubscribe).

thanks!

Comments

simon georges’s picture

Title: how do i change $unsubscribe_text? » How do I change $unsubscribe_text?

Hi,

You'll find in simplenews.module the function

function template_preprocess_simplenews_newsletter_footer(&$variables) {
  $variables['format'] = $variables['node']->simplenews['s_format'];
  $variables['unsubscribe_text'] = t('Unsubscribe from this newsletter', array(), $variables['language']->language);
  $variables['test_message'] = t('This is a test version of the newsletter.', array(), $variables['language']->language);
}

So, in your theme, you can just use a

my_theme_preprocess_simplenews_newsletter_footer(&$variables) {
   $variables['unsubscribe_text'] = t('My new text', array(), $variables['language']->language);
}

and that should do the trick.

enkara’s picture

Category: support » feature

I was searching for the same. This solution is ok, but I think there should be some textarea where to change this, as there is to change the messages the subscriptors received on subscription/unsubscription.

I'm changing it as feature request.

simon georges’s picture

Version: 6.x-1.3 » 6.x-2.x-dev

No new feature will be added to 6.x-1.x. I'm changing the version.

Sepero’s picture

It seems very bizarre that some text areas are edited in template.php, and others in the web interface. It doesn't bother me whether it's one way or the other, but if I may, I would like to suggest that it be made consistent throughout.

Sepero’s picture

I just tried adding this code listed to my template.php, edited in my theme name, and it appears not to be working.

function my_theme_preprocess_simplenews_newsletter_footer(&$variables) {
   $variables['unsubscribe_text'] = t('My new text', array(), $variables['language']->language);
}

Maybe I'm missing an unlisted step or something. It looks like for now I'm going to have to resort to creating and alternate simplenews-newsletter-footer.tpl.php instead. Any tips on why the preprocess function isn't working would be appreciated. ty

EDIT:
After clearing my cache, the new function is now working properly.

miro_dietiker’s picture

Category: feature » support
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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