Hi,
I want to add some other information to user's profile page, not just the profile information. So I add

function template_preprocess_profile2(&$var) {
  $var['test'] = 'nihao';
  dvm($var['test'] );
}

to my modulename.module file.
Also, I try to add

function bartik_process_profile2(&$var) {
  $var['test'] = 'nihao';
  dvm($var['test']);
}

in theme bartik's template.php file, which is my default theme.
Neither of these two ways could successfully make variable $test available to profile2.tpl.php.
print $test;
would give Notice: Undefined variable: test.
Is it because entity profile2 make use of function template_preprocess_entity(&$variables) ? So, other preprocess function or process function is not allowed to override the default variables?
Anyone could help? Thank you!

Comments

Jason Dean’s picture

Issue summary: View changes

I found the solution here :)

smiletrl’s picture

Status: Active » Closed (won't fix)

Although this is a pretty old post. Thanks!