I've got hook_form_alter working for me now, but I can't wrap my brain around altering the user landing page. For example, http://mydomain.com/user/1.

Background:
-After successfully logging in, the menu in D7 changes along the top. ex. "Hello root"
-Clicking on "Hello root" changes the URL to http://mydomain.com/user
-The page is rendered with three tabs: "view, edit, shortcuts"

I want to alter the 'view' tab to include a little extra text below the "History" information, except I don't know how to access it. The form ID returns search-block-form, but that is not how to alter the 'view' tab information. Any ideas how to alter the information on the 'view' tab?

Update:

I tried this code, but nothing shows:

function cg_volunteer_user_view_alter() {
    $form['user']['cleanup'] = array(
     '#type' => 'markup',
     '#markup' => variable_get('user_information', t('Hello world!')),
     );

Comments

technicalknockout’s picture

Try hook_user_view :

<?php

function mymodule_user_view($account) {
	$account->content['My section']['Greeting'] = array(
	   '#type' => 'user_profile_item',
	   '#title' => t('Greeting'),
	   '#markup' => t('Hello from Drupal forum!'),
	);
}
?>

- - turpana.com - -

mpapet’s picture

Thank you. This works in D7.