Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I have custom fields made for user registration and Newsletters are show after Username / Email, i tried to find something like this: http://drupal.org/node/998862 and i only found this solution at mailchimp_list.module:
$lists = mailchimp_lists_get_available_lists($account,
MAILCHIMP_LISTTYPE_OPTIONAL, array('show_register_form' => 1));
if (!empty($lists)) {
// wrap in a fieldset
$form['mailchimp_lists'] = array(
'#type' => 'fieldset',
'#title' => t('Newsletters'),
'#tree' => TRUE
);
Add " '#weight' => 50,":
$lists = mailchimp_lists_get_available_lists($account,
MAILCHIMP_LISTTYPE_OPTIONAL, array('show_register_form' => 1));
if (!empty($lists)) {
// wrap in a fieldset
$form['mailchimp_lists'] = array(
'#type' => 'fieldset',
'#title' => t('Newsletters'),
'#weight' => 50,
'#tree' => TRUE
);
There is the only solution i found to see always at end of register form. Can be do more user friendly?
Comment | File | Size | Author |
---|---|---|---|
#3 | mailchimp-add-lists-to-user-entity-1389708-3.patch | 736 bytes | jasonawant |
Comments
Comment #1
adshill CreditAttribution: adshill commentedI believe this should be committed. It would be better to be user configurable but to not have a weight means it just floats in a the registration form without any way to control it. This at least makes it appear in a sensible place.
Comment #2
levelos CreditAttribution: levelos commentedGuys, this is hardly reviewed and tested by the community, there's not even a patch file in the issue. I hardly see how hardcoding a weight of 50 is better than no weight at all. This problem is also easily solved with a hook_form_alter().
Comment #3
jasonawantHi,
What do you think about this approach? I've added the mailchimp_list form element as an extra field to the user entity. This exposes it the UI for drag&drop placement for the user register and profile forms and any other display mode if desired.
Sorry, I've re-opened this instead of creating a new feature request..I didn't realize is was closed until after I made the patch!
Jason
Comment #4
amytswan CreditAttribution: amytswan at ThinkShout commented“And now our watch [for support of the 7.x-2.x version of the MailChimp module] has ended…” With the approaching deprecation of MailChimp’s API version 2.0, I’m sad to say we too must turn the page. This branch will become unsupported in early October and officially deprecated by the end of this year (2016).
Fret not! The 7.x-4.x and 8.x versions come highly recommended. Both are using Mailchimp’s new API 3.0 and are being actively maintained. If you find this issue still exists on either the 7.x-4.x or 8.x branches, let us know by opening a new ticket. “What is dead may never die, but rises again, harder and stronger!”