Link to home
Start Free TrialLog in
Avatar of glepiza
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_theme() {
  $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_preprocess_user_register_form'
    ),
  );
return $items;
}

function adaptivetheme_subtheme_preprocess_user_register_form(&$vars) {
  $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-login-form-wrapper">
  <?php print drupal_render_children($form) ?>
</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
Avatar of glepiza
glepiza

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial