سؤال

I want to change the label of a registration form from 'Username' to name. I had used 'String overrides' module. But its not effecting. Is there any way out. please help me out.

هل كانت مفيدة؟

المحلول

Implement your custom module and alter the registration form.

/**
 * Implements hook_form_FORM_ID_alter().
 */
function MyMODULE_form_user_register_form_alter(&$form, &$form_state) {
  $form['account']['name']['#title'] = 'YOUR REPLACED VALUE'; //Username default
}

MyMODULE is your custom module name.

نصائح أخرى

If you are looking for the permanent change than you can got to

modules/user/user.module

under

function user_account_form

line number 1033 change the title to

'#title' => t('Name')

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top