1

I'm very new to drupal and programming.

I simply want to change some text on the simplenews "subscribe"/"unsubscribe" buttons.

From past questions I understand the only solution is programmatically? I've seen the hook_page_alter() method mentioned but I am not experienced enough to get it to work.

This is my poor attempt at utilizing it:

 function MYTHEME_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'simplenews_subscriptions_block') {
       $form['New button text'] = array(
           '#markup' => '<p> New button text </p>',
       )    
    } 
}
4
  • There are solutions without code, in D7 you had the string overrides and in D8 you can use an english-to-english translation.
    – 4uk4
    Mar 22, 2017 at 12:47
  • Thanks, I figured it out. It was under admin/config/people/simplenews/settings/subscriber/fields/ for anyone else looking for it. If you get the error message "The configuration objects have different language codes so they cannot be translated:" look at this thread for the solution for that: drupal.stackexchange.com/questions/223665/… Mar 22, 2017 at 13:27
  • Please post your solution as an answer
    – Matt
    Mar 22, 2017 at 15:41
  • I just posted the above comment as an answer @Matt Mar 22, 2017 at 19:40

1 Answer 1

1

I figured it out due to 4k4's comment

Basically you can translate it english-to-english under /admin/config/people/simplenews/settings/subscriber/fields/ It's a part of the configuration translation module.

If you get the error message "The configuration objects have different language codes so they cannot be translated:" look at this thread for the solution for that: How to change default language for configuration entities

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.