Show account email address on profile2 output
Thanks to @manarth for the top tip on this one.
Seems that after a lot of digging, hook_profile2_view was the one I was after.
/** * Implements hook_profile2_view() */ function candidate_show_email_profile2_view($profile, $view_mode, $langcode) { // load profile $profile_user = user_load(array('uid' => arg(1))); // load email in to variable $profile_user_mail = $profile_user->mail; // add our output to correct group on profile page $profile->content['#group_children']['user_email_address'] = 'group_your_details'; // create item to be inserted in to array for output $profile->content['user_email_address'] = array( '#theme' => 'field', '#title' => t('Email address'), '#label_display' => 'above', '#weight' => -1, '0' => array( '#markup' => $profile_user_mail, ), // #items outputs value '#items' => array( '0' => array( 'value' => $profile_user_mail, ), ), ); }









