By Simon Blomqvist on Thursday, 11 September 2014
Posted in General Issues
Likes 0
Views 528
Votes 0
I building a social network for car enthusiasts and added some custom fields about their car for exampel. Car model, picture of the car, horsepower...
Now I want to display these fields on their profile so everyone can see info about the users car, how can I do this? Can I maybe add those fields to a module that displays on the profile? Or can I display these fields under profile avatar? Or anywhere else?
Hello Simon,

In order to achieve this, you will need to customize the theme file to output the custom field's value. In short, the syntax to retrieve a custom field value would be something like this,


<?php
// Assuming that the $id is the person's user id.
$my = FD::user($id);

// The SECRET_UNIQUE_KEY can be found when you edit the custom field of a profile type at the back end.
echo $my->getFieldValue('SECRET_UNIQUE_KEY');

?>
·
Friday, 12 September 2014 15:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Simon Blomqvist,

Sorry for late reply to this,
Can you provide us with your Joomla backend and FTP access so we can better have a look?
Correct me if i getting wrong your meaning here, do you mean that you would like to put 1 custom field show in user profile there? Check my screenshot below. Please advise.
·
Friday, 12 September 2014 02:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Arlex Wong wrote:

Hello Simon Blomqvist,

Sorry for late reply to this,
Can you provide us with your Joomla backend and FTP access so we can better have a look?
Correct me if i getting wrong your meaning here, do you mean that you would like to put 1 custom field show in user profile there? Check my screenshot below. Please advise.


I have now sent the login details to you!
In the easysocial component I went to the profile types, then Registered Users and then custom fields. I want the workflow "Din Bil" (in english it means your car) to appear on the profile of each user. Just as you showed me in the picture, but with all the fields and the picture they uploaded in the "Your car". Or maybe in a widget / module on the profile page. Thank you!
·
Friday, 12 September 2014 15:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for the reply, Please tell me where I can find this "Theme" file that I have to customize
·
Friday, 12 September 2014 15:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Simon,

If you want to customize the profile header, you can edit the file /components/com_easysocial/themes/wireframe/profile/default.header.php
·
Friday, 12 September 2014 17:07
·
0 Likes
·
0 Votes
·
0 Comments
·
When I use the code you helped me with, it only render my own (or logged in user) profile custom field on every profile?
·
Monday, 15 September 2014 17:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Ooh, my bad! Solved it with replacing $id with $user THANK YOU !!!!!!!!
·
Monday, 15 September 2014 17:32
·
0 Likes
·
0 Votes
·
0 Comments
·
How to call img in a custom field?
·
Monday, 15 September 2014 19:06
·
0 Likes
·
0 Votes
·
0 Comments
·
What do you mean by calling image in a custom field?
·
Tuesday, 16 September 2014 00:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Like we talked about earlier in this thread:
Using syntax to retrieve a custom field value:

<?php
// Assuming that the $id is the person's user id.
$my = FD::user($id);

// The SECRET_UNIQUE_KEY can be found when you edit the custom field of a profile type at the back end.
echo $my->getFieldValue('SECRET_UNIQUE_KEY');

?>

Now I want to retrieve a custom field value from an uploaded image, so I can show the uploaded image on my profile (like an avatar), if I use this code you gave me it doesn´t work for images.
·
Tuesday, 16 September 2014 15:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Simon,

If you are retrieving avatars, you don't use this method to retrieve the source of the image. Instead, it should be something like this,


<img src="<?php echo $my->getAvatar();?>" />
·
Tuesday, 16 September 2014 22:55
·
0 Likes
·
0 Votes
·
0 Comments
·
You are Best! Thank you!!!!
·
Tuesday, 16 September 2014 23:18
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Tuesday, 16 September 2014 23:46
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post