Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can change this on several layers: </p> <h2>Translations:</h2> <p>In settings.php you see some examples already, just add:</p> <p>$conf['locale_custom_strings_en'][''] = array( 'Username' => 'Nickname', 'username' => 'nickname', );</p> <p>You might want to override more strings, that contain username, such as "The username is invalid". The UX is bad when you start mixing up these words, so in order to do what you want properly, you will <em>have</em> to change several such strings anyway, even if you go with one of the other options below. Most notably you will need to give the validation and error strings some attention.</p> <p>This, however, will change "username" to "nickname" sidewide! Also for admins and moderators. This might have unwanted side-effects, based on you broader specs and wishes. </p> <h2>Theme override:</h2> <p>In the template.php, you can override anything that gets passed to screen. In this case, you will need to override <a href="https://drupal.org/node/19855" rel="nofollow">the login form template</a>.</p> <p>The explicit code is too much to type in here. But in rough lines you need to:</p> <ol> <li>Tell Drupal you want to use a template for the user login form with <code>hook_theme</code>.</li> <li>Create the template file. And use any HTML you wish in there.</li> </ol> <h2>Form override:</h2> <p>In your theme and in modules, you can use <a href="http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_FORM_ID_alter/7" rel="nofollow">hook_form_alter</a> to override any theme.</p> <p>In your theme, you would add to template.php:</p> <pre><code>function your_template_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) { $form['account']['name']['#title'] = t('Nickname'); } </code></pre> <p>Or, if you want more business logic (which does <em>not</em> belong in the theme layer), you'd create a module and <a href="http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7" rel="nofollow">add a form_alter</a> there:</p> <pre><code>function your_modulename_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) { if (_your_module_is_person_from_irc()) { $form['account']['name']['#title'] = t('Nickname'); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload