Skip to main content
Changed title, update tags and formatted text
Source Link
Inizio
  • 3.5k
  • 13
  • 19

I define variables in template.phptemplate.php file preprocess_pagepreprocess_page but it come undefined in tpl.phptpl.php files. What can be a problem? Here is code

in template.php file

$user_profile = profile2_load_by_user($uid, 'user_profile');
$vars['user_profile'] = $user_profile;

in tpl.php file

print_r($user_profile);

I define variables in template.php file preprocess_page but it come undefined in tpl.php files. What can be a problem? Here is code

in template.php file

$user_profile = profile2_load_by_user($uid, 'user_profile');
$vars['user_profile'] = $user_profile;

in tpl.php file

print_r($user_profile);

I define variables in template.php file preprocess_page but it come undefined in tpl.php files. What can be a problem? Here is code

template.php file

$user_profile = profile2_load_by_user($uid, 'user_profile');
$vars['user_profile'] = $user_profile;

tpl.php file

print_r($user_profile);
Source Link

From template.phl to tpl.php

I define variables in template.php file preprocess_page but it come undefined in tpl.php files. What can be a problem? Here is code

in template.php file

$user_profile = profile2_load_by_user($uid, 'user_profile');
$vars['user_profile'] = $user_profile;

in tpl.php file

print_r($user_profile);