By Viktor Andreev on Saturday, 28 December 2019
Posted in General Issues
Likes 0
Views 640
Votes 0
Hi!
I want to change the info under the name in the profile view, so that instead user type (registered user, guest .. etc.) to show a data from a custom field ("profession" for example).
How can achieve that and which .php file I have to override ?
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

If you would like to show the user about page first when access user profile page, you can change the setting from backend > Easysocial > setting > user > profile > https://monosnap.com/file/GGC6F9cIj86AYhGvJ8cAGDemBrzBVc

If you would like to change those profile type name "Registered user" to other name, you can edit this from backend > Easysocial > users > profile type > edit "Registered user"
·
Saturday, 28 December 2019 12:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Arlex,
thanks for your reply.

Maybe I didn't described well enough my problem.

In my community I want to tag people with their interests (art, music, dance, writing ... etc.)
And because many of them have more then one interest I can't use Profile Types to for that (one can be interested in, for example "art and music" and other "writing, music and dance").
So, I have to use a Custom Field defined as "Interests" where they can list one or few of them.
And because they all are in the same Profile Type - "Registered User" instead there I want to show their interests, as this is the main thing connecting people in my community.

So,
1) I need to know which .php file controls the User Profile View
2) I need support in creating an override of this file in such a way that instead of showing the user's profile type, to display a data from particular custom field.

I hope now it is more clear.

I thing a relatively similar cases was supported at those topics:
https://stackideas.com/forums/which-php-file-controls-the-sidebar-on-main-profile#reply-475451
https://stackideas.com/forums/modify-display-of-profile

so if you can support me in similar manner I will be grateful.

Regards,
Viktor
·
Saturday, 28 December 2019 23:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Arlex,
in the meantime I have found the file (../helpers/cover/user.php ) and the code is around line 211:

<?php echo $user->getProfile()->get('title');?>


And I'm trying to make it output the data from the Custom Field "COM_EASYSOCIAL_PROFILES_USER_INTERESTS" with this:

<?php echo $this->render('site/fields/about/default', 'COM_EASYSOCIAL_PROFILES_USER_INTERESTS');?>

, but it doesn't work ........ can you help me with that line, please ?

regards,
Viktor
·
Sunday, 29 December 2019 08:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes I like this idea too bcs this is for me as I think more relevant info to have about the user profile instead of what kind of register group that person belong too. That could be seen on other fields view for the profile iteself for admin etc
·
Sunday, 29 December 2019 20:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Viktor,

You might want to directly get the field value:

<?php
$interestValue = $user->getFieldValue('INTEREST')->value;
// 'INTEREST' is the Custom Field's Unique Key: https://take.ms/llNhU
?>


Hope this helps.
·
Monday, 30 December 2019 11:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey, NIK FARIS
Happy new 2020 !!!

Thank you very much for the help with this.
·
Wednesday, 15 January 2020 20:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hmm, for some reason it doesn't get the value.
1) I have made a textarea field with unique key INTEREST and populated it with some text value

2) Quickly changed:

<span>
<a href="<?php echo $user->getProfile()->getPermalink();?>" >
<i class="fa fa-shield-alt"></i>  <?php echo $user->getProfile()->get('title');?>
</a>
</span>

to this one:

<span>
<a href="<?php echo $user->getProfile()->getPermalink();?>" >
<i class="fa fa-shield-alt"></i>  <?php $interestValue = $user->getFieldValue('INTEREST')->value;?>
</a>
</span>

and it doesn't return the value

Any idea ?
·
Wednesday, 15 January 2020 21:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Try take a look at my attached screenshot below and modify to this following code and see how it goes.


<i class="fa fa-shield-alt"></i>  <?php echo $user->getFieldValue('INTEREST');?>
·
Thursday, 16 January 2020 10:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey, Arlex
Yes, now it work.

Much appreciate your support. Thanks !

Best regards,
Viktor
·
Thursday, 16 January 2020 18:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Thursday, 16 January 2020 18:54
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post