How to adjust weight of profile 2 fields I added some fields to the default user registration form. I then installed the Profile 2 Module through which I added three (3) fields- "first name", "surname" and "place of work".

Is there a way to make the first name and surname fields appear above the default user registration fields while the place of work appears below it?

Thank you.
You will have to use the Drupal Form API to achieve that.

You basically need to alter the structure of the form before it gets rendered.

If you are using the Profile2 module, the best way to go about it would be to implement hook_form_profile2_edit_PROFILE_TYPE_form_alter()in a custom module.

You will then need to transform the $form array as needed (change field weights, and field positions).

For example:

function MODULE_NAME_form_profile2_edit_YOUR_PROFILE_TYPE_form_alter(&amp;$form, &amp;$form_state) {
  // Apply transformations to $form
  // e.g. change field weights
  $form['your_custom_profile_type']['place_of_work']['#weight'] = '-10';

  // e.g. copy field into new position
  $form['account']['place_of_work'] = $form['your_custom_profile_type']['place_of_work'];

  // Add a custom pre_render function to prevent the field from showing up again in the form
  $form['#pre_render'][] = 'MODULE_NAME_pre_render';
}


The pre_render function could look like this:

function MODULE_NAME_pre_render(&amp;$form) {
  // Prevent custom field from displaying twice
  unset($form['your_custom_profile_type']['place_of_work']);
  return $form;
}