hi folks,
when you need to register, drupal takes you to the
user/register
page that gives you a little text and a box to enter your info.
how do i edit the text on this page?
thanks, this is a wonderful email list and a wonderful community.
-- will
On Thursday February 15 2007 12:05 pm, will hall wrote:
hi folks,
when you need to register, drupal takes you to the
user/register
page that gives you a little text and a box to enter your info.
how do i edit the text on this page?
thanks, this is a wonderful email list and a wonderful community.
-- will
You can either hack user.module, which is not advisable, or you can create a custom module and use hook_form_alter [1]. It's not really that difficult nor that much code. The Form Inspect module [2] will be helpful here.
[1] http://api.drupal.org/api/5/function/hook_form_alter [2] http://drupal.org/project/forminspect
hacking user.module sounds more doable. the implication is that if there is an upgrade we'd have to re-hack, right? or are you just worried that i don't hack carelessly?
Jason Flatt wrote:
On Thursday February 15 2007 12:05 pm, will hall wrote:
hi folks,
when you need to register, drupal takes you to the
user/register
page that gives you a little text and a box to enter your info.
how do i edit the text on this page?
thanks, this is a wonderful email list and a wonderful community.
-- will
You can either hack user.module, which is not advisable, or you can create a custom module and use hook_form_alter [1]. It's not really that difficult nor that much code. The Form Inspect module [2] will be helpful here.
[1] http://api.drupal.org/api/5/function/hook_form_alter [2] http://drupal.org/project/forminspect
On Friday February 16 2007 12:40 pm, will hall wrote:
hacking user.module sounds more doable. the implication is that if there is an upgrade we'd have to re-hack, right?
Yes, and that it's not the Drupal Way(tm).
It's really not that difficult. Put the following D5 code in a file named zzz_mods.module in a relevant location in your sites directory, create a corresponding .info file, enable it and tweak away. (I changed the titles to both fields.) If these are not the fields you wanted to change, find the relevant form definitions in the core files, copy, paste and tweak. (If they are from a different form, you will need to update the case statement.) No core hacking necessary, and probably very little, if anything, in the way of tweaking for upgrades.
<?php function zzz_mods_form_alter($form_id, &$form) { switch ($form_id) { case 'user_register': $form['name'] = array('#type' => 'textfield', '#title' => t('This is where you type in your user name'), '#size' => 30, '#maxlength' => 60, '#description' => t('Your full name or your preferred username; only letters, numbers and spaces are allowed.'), '#required' => TRUE, ); $form['mail'] = array('#type' => 'textfield', '#title' => t('This is where you type in your e-mail address'), '#size' => 30, '#maxlength' => 64, '#description' => t('A password and instructions will be sent to this e-mail address, so make sure it is accurate.'), '#required' => TRUE, ); break; } }
cool thanks jason. i am fwding this to one of our coders to look at.
-- will
Jason Flatt wrote:
On Friday February 16 2007 12:40 pm, will hall wrote:
hacking user.module sounds more doable. the implication is that if there is an upgrade we'd have to re-hack, right?
Yes, and that it's not the Drupal Way(tm).
It's really not that difficult. Put the following D5 code in a file named zzz_mods.module in a relevant location in your sites directory, create a corresponding .info file, enable it and tweak away. (I changed the titles to both fields.) If these are not the fields you wanted to change, find the relevant form definitions in the core files, copy, paste and tweak. (If they are from a different form, you will need to update the case statement.) No core hacking necessary, and probably very little, if anything, in the way of tweaking for upgrades.
<?php function zzz_mods_form_alter($form_id, &$form) { switch ($form_id) { case 'user_register': $form['name'] = array('#type' => 'textfield', '#title' => t('This is where you type in your user name'), '#size' => 30, '#maxlength' => 60, '#description' => t('Your full name or your preferred username; only letters, numbers and spaces are allowed.'), '#required' => TRUE, ); $form['mail'] = array('#type' => 'textfield', '#title' => t('This is where you type in your e-mail address'), '#size' => 30, '#maxlength' => 64, '#description' => t('A password and instructions will be sent to this e-mail address, so make sure it is accurate.'), '#required' => TRUE, ); break; } }
On 16/02/07, will hall will@theicarusproject.net wrote:
how do i edit the text on this page?
The registration guidelines text above the form?
on 4.7 you edit it at : /admin/settings/user (it might be the same in 5.x)
If you want to change the text in the form itself, try the locale module.
wow thanks i will look into that. easier than creating a mod...
Anton wrote:
On 16/02/07, will hall will@theicarusproject.net wrote:
how do i edit the text on this page?
The registration guidelines text above the form?
on 4.7 you edit it at : /admin/settings/user (it might be the same in 5.x)
If you want to change the text in the form itself, try the locale module.