What is the best way to theme the editable user and profile pages. I want to omit some fields from editing and rearrange a couple others.

Is there a better way to do this than to edit profile_form_profile directly?

Comments

alper’s picture

After asking around on #drupal-themes on IRC, I found some partial solutions to this problem.

You can get into the markup of a form by creating a function called theme_FORMID in your themeing code. Replace FORMID with the id of the form that you want to theme. The structure of the function is explained in: http://api.drupal.org/api/HEAD/file/developer/topics/forms_api.html ("Theming Forms" section 2).
Note that you can't do too much stuff with the form you get, because the form has already been created. You can just influence some rendering features of the form (i.e. not add fields).

The other way would be to implement the form_alter hook. Documentation on this is sparse, but it seems that you cannot do this from a theme anyway and you would have to create your own module. Your hook would then be executed depending on the load orderd of your module.