How can I customize user registration page?
Hi all, I'm trying to customize user registration page by profile module. But the fields I set by profile module are placed in another filedset, not the same fieldset email and password fields are placed in. How can I place them in the same fieldset ? to use hook_form_alter() ? Are there any functions like phptemplate_user_profile() to be overridden for user registration page style? Thank you, Huisi
I believe the easiest way to do this is to theme the user registration page in template.php with theme_user_register() and theme_user_edit(). For instance like this: http://drupal.pastebin.us/27745 You can start your $weight however you like to define positioning. Wim Huisi Wang wrote:
Hi all,
I'm trying to customize user registration page by profile module. But the fields I set by profile module are placed in another filedset, not the same fieldset email and password fields are placed in.
How can I place them in the same fieldset ? to use hook_form_alter() ? Are there any functions like phptemplate_user_profile() to be overridden for user registration page style?
Thank you,
Huisi
2007/4/23, Wim Mostrey <drupal@mostrey.be>:
I believe the easiest way to do this is to theme the user registration page in template.php with theme_user_register() and theme_user_edit().
For instance like this: http://drupal.pastebin.us/27745
You can start your $weight however you like to define positioning.
Thanks for your answer. Where can I find the documentation of theme_user_register() and theme_user_edit()? I can't find them from api.drupal.org. I can't find the documentation of phptemplate_user_profile() in api.drupal.org. I will try out the PHP snippet. Thank you. Huisi
Well you're calling theme_$formid so that can be theme_story_node_form() for the "add story" form as well. I'm not sure this feature is documented. The basic functionality is this: http://drupal.pastebin.us/27764 You can put the code of my previous mail where the comment is placed. Wim Huisi Wang wrote:
2007/4/23, Wim Mostrey <drupal@mostrey.be>:
I believe the easiest way to do this is to theme the user registration page in template.php with theme_user_register() and theme_user_edit().
For instance like this: http://drupal.pastebin.us/27745
You can start your $weight however you like to define positioning.
Thanks for your answer.
Where can I find the documentation of theme_user_register() and theme_user_edit()? I can't find them from api.drupal.org. I can't find the documentation of phptemplate_user_profile() in api.drupal.org.
I will try out the PHP snippet. Thank you.
Huisi
2007/4/23, Wim Mostrey <drupal@mostrey.be>:
Well you're calling theme_$formid so that can be theme_story_node_form() for the "add story" form as well. I'm not sure this feature is documented.
The basic functionality is this: http://drupal.pastebin.us/27764
You can put the code of my previous mail where the comment is placed.
Thank you. I can use the function as theme_$form_id, but what's the parameters? I have tried out the PHP snippet, but it didn't work for my expectation. I think the problem was caused by form's field name. The PHP snippet is just for $form['account'], but the field I added by 'profile' is $form['ANY_ELSE']. And I tested script below: function theme_user_register($form) { $form['account']['profile_newsletter'] = array(); $form['account']['profile_newsletter'] = $form['Personal']['profile_newsletter']; } It didn't work. The field was out of the original fieldset. I should test more. Thank you. Huisi
Please take a look at the pastebin I provided. You forgot the following at the end: $output = drupal_render($form); return $output; Wim Huisi Wang wrote:
2007/4/23, Wim Mostrey <drupal@mostrey.be>:
Well you're calling theme_$formid so that can be theme_story_node_form() for the "add story" form as well. I'm not sure this feature is documented.
The basic functionality is this: http://drupal.pastebin.us/27764
You can put the code of my previous mail where the comment is placed.
Thank you.
I can use the function as theme_$form_id, but what's the parameters?
I have tried out the PHP snippet, but it didn't work for my expectation. I think the problem was caused by form's field name. The PHP snippet is just for $form['account'], but the field I added by 'profile' is $form['ANY_ELSE']. And I tested script below:
function theme_user_register($form) { $form['account']['profile_newsletter'] = array(); $form['account']['profile_newsletter'] = $form['Personal']['profile_newsletter']; }
It didn't work. The field was out of the original fieldset. I should test more.
Thank you.
Huisi
2007/4/24, Wim Mostrey <drupal@mostrey.be>:
Please take a look at the pastebin I provided. You forgot the following at the end:
$output = drupal_render($form); return $output;
Yes, it was my fault. It works now. Thank you. Huisi
participants (2)
-
Huisi Wang -
Wim Mostrey