2

I have created a custom profile in CiviCRM (Administer > Custom Data and Screens > Profiles) designated to be displayed on the Drupal registration page (see second screenshot), for users creating a new account. Initially, the CiviCRM profile was listed after the Drupal core elements: username, password, etc. But now the custom CiviCRM profile is displayed first.

How can I rearrange the order? I looked in Drupal blocks and do not see anything regarding these and I've tried assigning an order of "50" to no avail.

CiviCRM 4.7.27, Drupal 7

In the screenshot below, you can see that the "Tell us more" and darker text section is the CiviCRM custom profile and what follows it are the Drupal core elements that I want to be at the top.

enter image description here

enter image description here

  • Ignore - I misread question and can't delete comment. – Demerit Dec 9 '17 at 20:13
  • I am not sure what happened but this corrected itself. – Christia Oct 2 '18 at 17:55
1

You need to use a hook_form_alter function in Drupal to accomplish this. In doing so, you can modify the weight of the items to appear below the existing form items.

function yourmod_form_alter(&$form, &$form_state, $formID) {
  if (($formID == 'user_register_form')) {
    $form['civicrm-profile-register']['#weight'] = somevalue;
  }
}
  • 1
    What Christia is describing is not default Drupal behaviour is it? This code may indeed achieve what she wants, but I wonder what the underlying cause of this is. eg theme? another module? – petednz - fuzion Mar 14 '18 at 18:23
  • It didn't used to be in this order either so something must have changed it, like you said. I'll have to see if I can identify what module or theme changes were made around the time that it changed. Changes to the weight has no affect. – Christia Mar 15 '18 at 7:42

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.