Versions 7.x-2.6 and 7.x-2.6+2-dev

When I try to override the Mailchimp Block title for a list in the blocks admin UI, the value entered in the Title field is saved but NOT displayed. I've tried with ''. I've tried flushing all caches & restarting the server. No change. Broken.

Edit - Tried every version from 7.x-2.6+2-dev down to 7.x-2.0-Rc2. Same problem. In the end, I installed 2.5 - I prefer the 'Subscribe' label to the more generic 'Save'.

Comments

bleedev’s picture

Status: Active » Closed (cannot reproduce)

Steps taken (using Mailchimp 7.x-2.x-dev):

  • Goto: admin/structure/block
  • Click on "Configure" next to MailChimp block
  • Edit "Block title"
  • Click "Save"

Block title entered is shown as the title on the MailChimp block.

bisonbleu’s picture

Hum... Looking back at this, I think that I might have been thinking about the subtitle of this block.

I'm definitely able to change the block's name as suggested in #1. But what I really wanted was to be able to change the 'Sign up for [title_of_list]' that appears just underneath.

AFAIK, the only way to do this is by 'hacking' the mailchimp_lists.module or writing a custom module that overrides this string.

bensey’s picture

Title: Can't override the default title for the block » Remove compulsory 'Sign up for [title_of_list]' from description.
Category: bug » feature
Priority: Major » Normal
Status: Closed (cannot reproduce) » Active

I agree,
I think the 'Sign up for [title_of_list]' text should not be hard-coded in the block description.
It kind of defeats the purpose of allowing people to customise the block message at all, when you have no control over that first line.
Maybe a better solution would be to display that hard-coded message if the description was left empty?

codesmith’s picture

Version: 7.x-2.6 » 7.x-2.9

Just upgraded and this is still an issue. Is there really no way to remove that text in the UI?

I did it with an override in template.php

function THEMENAME_form_mailchimp_lists_user_subscribe_form_NEWSLETTER-LABEL_alter(&$form, &$form_state, $form_id) {
  $form['mailchimp_lists']['mailchimp_NEWSLETTER-LABEL']['title']['#markup'] = '';
}

In my case NEWSLETTER-LABEL is 'newsletter_sign_up'

bensey’s picture

I've been doing the same thing, but with a hook_form_FORM_ID_alter implemented in a custom module.

function CUSTOM-MODULE_form_MAILCHIMP-FORM-ID_alter(&$form, &$form_state){
    $form['mailchimp_lists']['mailchimp_LIST-NAME']['title']['#markup'] = '';
}

Just thought I'd share another solution that's not theme specific.

It would be good to not have to do this for every site and Mail Chimp list however.

mibfire’s picture

function MYMODULE_form_alter(&$form, $form_state, $form_id) {
  if (isset($form['#attributes']['class'][0]) && $form['#attributes']['class'][0] == 'mailchimp-lists-user-subscribe-form') {
    foreach($form['mailchimp_lists'] as $key => $value) {
      if (is_array($value)) {
        $form['mailchimp_lists'][$key]['title']['#markup'] = '';
      }
    }
  }
}
roborracle’s picture

Perfect solution in #5 - but for the sake of clarity using the list's machine name instead of label is what did the trick for me.

sophiekovalevsky’s picture

I don't know yet how access to the fields of the module.
It was a problem try to find out the id of the form that I need to change.
For those who need it, download the get form id module http://drupal.org/project/get_form_id

function CUSTOM-MODULE_form_mailchimp-form-id_alter(&$form, &$form_state){
$form['mailchimp_lists']['mailchimp_id-of-the-list']['title']['#markup'] = '';
}

dagomar’s picture

Drop in fix at #6, works for me.

/* edit

Not a fix, but a workaround.

/edit

gcb’s picture

Status: Active » Closed (fixed)

Fixed in latest Dev release, rolling a new stable release soon.

gcb’s picture

Issue summary: View changes

added infos.