Closed (won't fix)
Project:
Profile 2
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jun 2012 at 01:46 UTC
Updated:
5 Mar 2014 at 09:12 UTC
Jump to comment: Most recent
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
Comment #1
Jason Dean commentedI found the solution here :)
Comment #2
smiletrl commentedAlthough this is a pretty old post. Thanks!