Is it possible to render one of Profile2 fields elswhere on the page, in some node ?
I would like to present user with opportunity to edit only one field on custom link or node.
Thanks
Retrieve Profile2 Profile Data Programmatically
Implement profile2_by_uid_load() to get the data.
$profile2_data = profile2_by_uid_load($user->uid, 'profile_id');
$profile2_data will be an object containing all the data from profile_id for the requested user.
Retrieve Profile2 Edit Form Programmatically
module_load_include('inc', 'profile2_page', 'profile2_page');
$profile2 = profile2_by_uid_load($user->uid, 'profile_id'); // profile_id = machine name
$entity_form = entity_ui_get_form('profile2', $profile2, 'edit');
return $entity_form;
module_load_include('inc', 'profile2_page', 'profile2_page');
$profile2 = profile2_by_uid_load($user->uid, 'profile_id');
- I got function undefined - even though that module_load_include
is meant to bring the function into scope. I used a different function as so: $profile = profile2_load_by_user($user_from_csv->uid, 'main');
which worked on its own (without the module_load_include
). This profile2_load_by_user
function that I used belongs to the profile2 module rather than the
Commented
Sep 29, 2015 at 6:03