Hello, newbie question here.
I would like to customize the user profile page, but maintain information added by other modules.
I have figured out how to customize the user profile page, by following the instructions here for creating a custom user_profile.tpl.php file: http://drupal.org/node/35728
However, when I create a custom user_profile.tpl.php file, I lose the information previously added by other modules. For example, the lm_paypal_subscriptions module has a function lm_paypal_subscriptions_user() which adds the user's list of subscriptions to the user profile page. After creating my custom user_profile.tpl.php file, the list of subscriptions no longer appears on the user profile page.
Can anyone give me a pointer on what I need to do to maintain info added by other modules to the user profile page?
Thanks very much!
P.S. Here is the lm_paypal_subscriptions_user() function:
/**
* Implementation of hook_user().
*/
function lm_paypal_subscriptions_user($op, &$edit, &$account, $category = NULL) {
_lm_paypal_subscriptions_ini();
global $_lm_paypal_debug;
global $user;
// TODO: On deleting a user issue a cancel on any subscriptions
// obviously not on PayPal (can't!) just on here.
// In the "my account" view area show any role subscriptions
// but only for admin looking at other users or the user themself
if ($op == 'view' && (user_access('administer lm_paypal') || $user->uid == $account->uid)) {
$output = lm_paypal_subscribe(null, 32, '', null, $account);
$sitems [] = array(
'title' => '',
'value' => $output);
$ret_subs = array(t('Subscriptions') => $sitems);
return $ret_subs;
}
}
Comments
same problem
Hey,
We would like to add also the options from the modules etc..
Can someone help us out please?
Thanks a lot
solution
For other newbies, here's the solution I came up with...
My first suggestion is to read about themes and in particular, overriding theme functions.
I found these sites especially helpful:
http://www.nicklewis.org/node/841
http://www.nicklewis.org/node/842
http://drupal.org/node/16011
And I found the following book especially good, which you can purchase online as an e-book:
"Drupal Pro Development" by VanDyk and Westgate
Worth its weight in gold. The chapter on theming gives an excellent conceptual overview.
Here's how I wanted to customize the use profile page:
a) customize the contact info.
b) delete the "History" section, which says how long the user has been a member of the site.
c) keep everything else, eg the list of newsletter subscriptions created by the simplenews module.
Following the instructions here: http://drupal.org/node/16011, I first added the following to template.php:
Then I cloned the theme_user_profile($account, $fields) function found in user.module, to create my custom user_profile.tpl.php as shown below:
Hope that helps. Good luck!
-- Mindy