1

i have used below code in a block to display the profile 2 fileds

<?php
print drupal_render(drupal_get_form('user_register_form'));
$profile = profile2_load_by_user($account);
print drupal_render(field_view_field('profile2', $profile['student'], 'field_class'));
?>

but the fields are displaying only on the site localhost/drupal/student/regsiter/, not in localhost/drupal/. I want the fields also to be displayed in localhost/drupal.Please help

6
  • Does it give you any error? Did you solve it? Commented Aug 9, 2012 at 15:17
  • It does not give any error. problem is fields are not getting displayed other than unique registraion path. So Developed custom module to display the fields. In drupal.org found that this functionality is in development status
    – Cindrella
    Commented Aug 10, 2012 at 13:21
  • did the print drupal_render(field_view_field('profile2', $profile['student'], 'field_class')); works? I'm trying to make it work but with no success... Commented Aug 10, 2012 at 13:41
  • No net at home. so late reply. yeah it worked for me. Used these statements . print drupal_render(drupal_get_form('user_register_form')); $profile = profile2_load_by_user($account); print drupal_render(field_view_field('profile2', $profile['Student'], 'field_class'));
    – Cindrella
    Commented Aug 13, 2012 at 4:45
  • Mohini, Thanks for you reply, I've posted a question, may you have a look please? drupal.stackexchange.com/questions/39329/… Thanks a lot Commented Aug 13, 2012 at 11:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.