Project:MailChimp
Version:6.x-2.0-rc1
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Just wondering if there is a way I can alter the output in the block. At the moment it's displayed as a fieldset which isn't ideal, and I would like to limit it to just requiring the email address and not all the other fields and options.

Comments

#1

Status:active» closed (fixed)

you can use hook_form_alter to change the form in any way you like. http://api.drupal.org/api/function/hook_form_alter/6

#2

Ok thanks. Sorry I'm still learning and I've nearly sorted it. The following code makes it just display the email field but I get an error when I submit.

$form['list_45b91236f8']['#type']=form;
$form['list_45b91236f8']['NAME']['#type']=hidden;
$form['list_45b91236f8']['GENDER']['#type']=hidden;
$form['list_45b91236f8']['AGE']['#type']=hidden;
$form['list_45b91236f8']['INTERESTS']['#type']=hidden;

The error is:

An illegal choice has been detected. Please contact the site administrator.

#3

Sorry ignore that, just found the answer

unset($form['list_45b91236f8']['#type']);
unset($form['list_45b91236f8']['NAME']['#type']);
unset($form['list_45b91236f8']['GENDER']['#type']);
unset($form['list_45b91236f8']['AGE']['#type']);
unset($form['list_45b91236f8']['INTERESTS']['#type']);

#4

Status:closed (fixed)» active

Where does one insert this code? in the module file or somewhere else?

Thanks ahead of time,

CarbonPig

#5

Status:active» closed (fixed)

FYI - You can manage which fields appear via the mailchimp form interface when you're loggen in over there. It updates on your local drupal version.

Cheers,

CarbonPig

nobody click here