glepiza
asked on
Alter drupal registration form
Dear experts,
I am trying to alter drupal registration form. But I am quite confused how to do it.
The first thing I am trying to do is to add some intro text to the form. To do that I added the following to my template.php file:
function adaptivetheme_subtheme_the me() {
$items = array();
$items['user_register_form '] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'adaptivetheme_subtheme') . '/templates',
'template' => 'user-register-form',
'preprocess functions' => array(
'adaptivetheme_subtheme_pr eprocess_u ser_regist er_form'
),
);
return $items;
}
function adaptivetheme_subtheme_pre process_us er_registe r_form(&$v ars) {
$vars['intro_text'] = t('Join us!.');
}
Then I created a user-register.form-tpl.php to render the form like this:
<p><?php print render($intro_text); ?></p>
<div class="yourtheme-user-logi n-form-wra pper">
<?php print drupal_render_children($fo rm) ?>
</div>
Now what I want to do is to change the labels to the form in order to show differently on the user profile page. for example. In the register form I ask: Tell us about yourself (text field). On the profile page I would like that to change that label to About Me.
Could you please please please guide me to do this? I am not sure if I should create a custom module and add the corresponding hooks… not pretty sure, I´ve been just reading couple of things that are making me even more confused.
I would greatly appreciate any help,
Winter
I am trying to alter drupal registration form. But I am quite confused how to do it.
The first thing I am trying to do is to add some intro text to the form. To do that I added the following to my template.php file:
function adaptivetheme_subtheme_the
$items = array();
$items['user_register_form
'render element' => 'form',
'path' => drupal_get_path('theme', 'adaptivetheme_subtheme') . '/templates',
'template' => 'user-register-form',
'preprocess functions' => array(
'adaptivetheme_subtheme_pr
),
);
return $items;
}
function adaptivetheme_subtheme_pre
$vars['intro_text'] = t('Join us!.');
}
Then I created a user-register.form-tpl.php
<p><?php print render($intro_text); ?></p>
<div class="yourtheme-user-logi
<?php print drupal_render_children($fo
</div>
Now what I want to do is to change the labels to the form in order to show differently on the user profile page. for example. In the register form I ask: Tell us about yourself (text field). On the profile page I would like that to change that label to About Me.
Could you please please please guide me to do this? I am not sure if I should create a custom module and add the corresponding hooks… not pretty sure, I´ve been just reading couple of things that are making me even more confused.
I would greatly appreciate any help,
Winter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.