Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We wanted to be able to theme and position and the check box on the registration page. At present there are no classes attached. I made the following changes to the module:
Original
line 143:
foreach ($lists as $list) {
if ( variable_get( 'mailchimp_list_'. $list['id'] .'_listtype', '' ) !== 'required' ) {
$list_form['chimpmail_list_'. $list['id']] = array(
'#type' => 'checkbox',
'#title' => $list["name"],
'#default_value' => variable_get( 'mailchimp_list_'. $list['id'] .'_listtype', '' ) == 'optout' ? true : false,
'#description' => variable_get( 'mailchimp_list_'. $list['id'] .'_description', '' ),
);
}
}
if( $list_form ) {
$form['chimpmail_lists'] = array(
'#type' => 'fieldset',
'#title' => t('Newsletter subscriptions'),
'#weight' => 5,
'#collapsible' => false,
to...
foreach ($lists as $list) {
if ( variable_get( 'mailchimp_list_'. $list['id'] .'_listtype', '' ) !== 'required' ) {
$list_form['chimpmail_list_'. $list['id']] = array(
'#type' => 'checkbox',
'#title' => $list["name"],
'#default_value' => variable_get( 'mailchimp_list_'. $list['id'] .'_listtype', '' ) == 'optout' ? true : false,
'#description' => variable_get( 'mailchimp_list_'. $list['id'] .'_description', '' ),
'#prefix' => '<div class="mailchimp-sub-check">',
'#suffix' => '</div>',
);
}
}
if( $list_form ) {
$form['chimpmail_lists'] = array(
'#type' => 'fieldset',
'#title' => t('Newsletter subscriptions'),
'#weight' => 5,
'#collapsible' => false,
'#prefix' => '<div class="mailchimp-form">',
'#suffix' => '</div>',
So basically just adding #prefix and #suffix to the fieldset and the checkbox. Would be great to slip these, and maybe some others, into the next release to enable theming.
Cheers,
Neil
Comments
Comment #1
levelos CreditAttribution: levelos commentedput in some classes in the most recent committ, hopefully enough to manipulate what you need. Duplicate of #427980: Add class to fieldset on registration page