0

I have added a Mailchimp Subscription field to an entity form using the Mailchimp module. I'm having difficulty in removing the fieldset around this subscription field.

I have installed the Devel module and used the dpm function to display info on the form. But I can't seem to find what theme function I need to override to remove the fieldset.

I have an existing form alter applied to this form, what would I need to add to my existing form alter to remove the fieldset around the field?

2
  • have you tried using css? – Scott Joudry May 9 '14 at 12:40
  • I can remove it with CSS but would prefer to do it through the theme layer if it's possible? – T Mardi May 9 '14 at 12:42
0

You need to use YOURTHEME_form_alter of YOURMODULE_form_alter https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7

there you can alter that form. dpm or print_r $form and see where that fieldset is defined and you can unset it

you will see something like

array( 
   'some_field' = array(
    '#title' = 'some title',
    '#type' = 'fieldset',
  )
)

then you can do

unset($form['some_field']['#type'])

that should do the job

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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