Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Alter drupal registration form

Posted on 2013-12-11
1
Medium Priority
?
610 Views
Last Modified: 2013-12-11
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
0
Comment
Question by:glepiza
1 Comment
 

Accepted Solution

by:
glepiza earned 0 total points
ID: 39712148
Well, I found the Field Display Label module which does just what I need for the labels. Thanks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A big percent of today’s marketing activity is performed through the online environment. The marketing strategies that have existed a decade ago no longer relate to what’s happening today. We’re currently facing a revolutionary era, called the digit…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question