I am reformatting the standard Drupal User Registration form on a site. Using the drupal_render() function, I am able to post all the fields onto the form without a problem. But, posting all the forms has lead to asking for duplicate information, which I consider bad design. I am using the library module, which requires the user to enter a first name and last name, but I also have that information available in the profile itself. Is there a way that I can do the following:
1. Use the profile module to get first and last name information.
2. Hide the library modules fields.
3. Use the profile module's fields to pass information to the library module fields, so that they are populated when the form is submitted. I'm using Drupal 6, if that isn't already obvious.
Thanks for the help!
zanlus
Comments
you can use the content
you can use the content profile to replace the profile module and define what should be displayed on the registration page
or you can use preprocess function in template.php to sort out the field that you want to display by modifying the $form variable
/** create user-register.tpl.php with these lines **/
print t('Join us');print t('Fill out the form to complete the registration process');print $rendered;print $debug; //debugging only--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com
I should have provided more information
Sorry, I'm afraid that I wasted your time by not giving more information. Let me try to fix that.
Here is the $hooks implementation in template.php using a zen subtheme:
I suspect that a preprocess function might do what I need, but the way that you have presented doesn't seem to fit. I want to control the display of each field on the page, which has lead me to use drupal_render to display the fields in the user-register.tpl.php file. Here are the fields that I need to present:
The fields that I want to hide are:
Based on your suggestion, I think I could do something like the following to hide the fields that I want to hide:
Then on the user-register.tpl.php, would the following assign the value of the revealed field to the hidden field?
I could of course try this, but I'd rather have someone who knows more than I do have a look before trying this approach.
Thanks for all the help!
I'm not a zen theme master, I
I'm not a zen theme master, I usually build theme from scratch so not too sure about the proper way to do this in zen language :)
after a quick glance :
This approach will failed if zen doesnt have $vars available, so best if you consult with zen documentation for proper way to do this.
--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com