By Alex Ortner on Wednesday, 04 October 2017
Posted in General Issues
Replies 3
Likes 0
Views 219
Votes 0
Dear Team,
In order to implement my template overrides I try to access the additional fields I created in the user/event workflows.
This are listed in the database tables
#__social_fields
and do have there values in
#__social_fields_data
Is there a way to access this fields via a already implemented function? or area they already stored in an available object/array?
Like I can access all the default fields from users and events via
$user->name
$event->title
Or do I have to write a own select statement directly on the database table?
Best Alex
Regarding the user/event custom field, you can use following method to retrieve your current user/event field data.


$userId = 347;
$userData = ES::user($userId); // current user object
// TEXTBOX-custom this unique key have to get it from your custom field, you can refer on my attached screenshot below.
$customField = $userData->getFieldValue('TEXTBOX-custom');
echo $customField;



$eventId = 42;
$eventData= ES::event($eventId); // get event object
$customField = $eventData->getFieldValue('ADDRESS');
echo $customField;exit;
·
Wednesday, 04 October 2017 19:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Fantastic. That is exactly what I searched and making live so much easier
·
Wednesday, 04 October 2017 21:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating Alex, glad that your issues are resolved now
·
Wednesday, 04 October 2017 21:51
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post