After installing tons of modules like guestbook, subscriptions etc. It also added tons of settings on user/$uid/edit page. How can I disable or rearrange them?

I guess theme_fieldset() would help me, but I have no idea how to use it correctly. And where to print_r($form) and in which template?


devel themer will help you understand what you can over ride and what variables are available.

hook_form_alter() can be used to trim fields that you don't want and to re order the form, put things into groups etc.



function hook_form_alter(&$form, $form_state, $form_id){
        case 'user-profile-form':
        // Change $form array to alter form components
  • thanks, in my case its node-form id. And how can i see a fieldset's id? – Alexander Kim Jun 13 '11 at 16:06
  • You will have to print_r($form) for its structure and to decide for your desired field-set to hide by unset($form['myfieldset']) – Shoaib Nawaz Jun 13 '11 at 17:18
  • can you post an example for "language fieldset" on user-edit page, please? I've created mymodule.module and pasted your code above, what to write in // Change $form array to alter form components? :) – Alexander Kim Jun 13 '11 at 17:39
  • (1) book_form_alter should be mymodule_form_alter – Shoaib Nawaz Jun 13 '11 at 19:13
  • thanks, but i've already knew that. I meant what to write inside function mymodule_form_alter(&$form, $form_state, $form_id){ switch($form_id) case 'user-profile-form': // What to write here? break; – Alexander Kim Jun 13 '11 at 19:29

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.