I know how to use hook_form_alter, but I'm little confused how to achieve this:
In user profile there are tabs "View" and "Edit".
In edit I can alter the form using switch statement on user_profile_form and adding a fields, but they don't appear when I click on "View" tab.
Let's say I'm adding a new field into the user_profile_form:
<?php
/*
* Implements hook_form_alter().
*/
function my_module_form_alter (&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'user_profile_form':
$form['account']['skype_title'] = array(
'#type' => 'markup',
'#markup' => '<div class="user-profile-skype">Skype edit</div>'
);
$form['account']['skype'] = array(
'#type' => 'textfield',
'#title' => t('New Skype'),
);
//krumo($form);
break;
}
}
How can I display this field into "View tab"?
Should I use another hook for this?
admin/config/people/accounts/fields