views:

28

answers:

1

Hey Guys,
I have made customized user registration page. and i have made that on theme layer.
But now i want to see the the fields which i have made in profile module.
as i have written like this for

<?php print drupal_render($form['account']['name']); ?>

this code will show the user name field. which is default. now i want to see the profile fields which i have created on the profile module.
So can any one tell me what i have to write in drupal_render[?]?
Thanks in advance.


Nitish
Panchjanya Corporation

+1  A: 

First, if you are using Drupal 6, you might want to know that you can just choose a checkbox, Appear in Registration page which shows up when you are creating a new user profile field from the Admin UI.

Else you can try this.

$categories = profile_categories();
foreach($categories as $category) {
  $result = _profile_get_fields($category['name']);
  # You can add code here to render each category seperately #
  while($field = db_result($result)) {
    $fieldname = $field['name'];
    drupal_render($form[$category][$fieldname]);
  }
}
Amar Ravikumar
do i have to change any thing in this code?...bcz its giving me warning like "Illegal offset"... when i have copied same code on my tpl file. i know about that checkbox but i want to create some good looking form so thats why i am making own customized....
Nitz
No no. This is not to be added to the tpl file but to the code (your own module preferably).
Amar Ravikumar
Yes..thank you...i got it...and now working perfectly...
Nitz