1

I have two profile types teacher and student

so far I have used profile2 module and the profile 2 registration path module. I have the core fields added

I am trying to add profile2 fields to my user-registration template

So far my template looks like this

<?php
print drupal_render($form['form_build_id']);
print drupal_render($form['form_id']);
?>


<?php print drupal_render($form['account']['name']); // prints the username field ?>
<?php print drupal_render($form['account']['mail']); // prints the mail field ?>
<?php print drupal_render($form['account']['pass']); // prints the password fields ?>


<?php print drupal_render($form['actions']['submit']); // print the submit button ?>
password is not being displayed

I am not sure how i can add profile2 fields to my registration form.

1

This link should help you in achieving it.

  • Welcome to Drupal Answers. Normally, answers with just links aren't considered good ones. Can you provide a short summary of how this will help with Profile 2 fields? – mpdonadio Jan 16 '13 at 12:04
1

Given Andrew's link, I found the solution to get a profile form array.

First, check 'Show during user account registration' under your profile configuration.

Then call

drupal_get_form('user_register_form')

That's it !

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.