drupal - Trying to print profile2 fields in other place error Missing bundle property on entity of type profile2 -


i trying print fields profile2 module on user page.

at present have profile called fun_profile (how ironic).

i using following code in user-profile.tpl.php file in theme.

<php $account = user_load($uid); $profile = profile2_load_by_user($account); print drupal_render(field_view_field('profile2', $profile['fun_profile'], 'field_eye_colour'));?> 

i trying print out field eye colour on user page.

i have basic html text printing word - hookum - make sure in right area.

essentially trying print user picture field created in profile2 , use in place of user picture user-profile....but away down road.

i thought start small , work up.

i keep getting error:

notice: undefined variable: uid in include() (line 43 of c:\users\tony\sites\acquia-drupal\sites\all\themes\skeletonthemeomallyes\templates\user-profile.tpl.php). warning: array_flip() [function.array-flip]: can flip string , integer values! in drupaldefaultentitycontroller->load() (line 178 of c:\users\tony\sites\acquia-drupal\includes\entity.inc). warning: array_flip() [function.array-flip]: can flip string , integer values! in drupaldefaultentitycontroller->cacheget() (line 355 of c:\users\tony\sites\acquia-drupal\includes\entity.inc). notice: undefined index: fun_profile in include() (line 43 of c:\users\tony\sites\acquia-drupal\sites\all\themes\skeletonthemeomallyes\templates\user-profile.tpl.php). entitymalformedexception: missing bundle property on entity of type profile2. in entity_extract_ids() (line 7633 of c:\users\tony\sites\acquia-drupal\includes\common.inc).

the code:

<php global $user; $uid = user_load($user->uid); $profile_main = profile2_load_by_user($uid, 'fun_profile'); ?>   <php print drupal_render(field_view_field('profile2', $profile_fun_profile, 'field_eye_colour', 'value'));?> 

prints out value eye colour - value doesn't change view other user-profiles - guessing due global.

any great,

tony.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -