Support Forum
I am trying to figure out how to have custom profile fields displayed and I am unsure of how to go about it. Ideally, I would like the field displayed underneath a users avatar as well as in their profile underneath their bio.
From what I can gather from the codex, in order to have it display under the avatar, I would insert this tag in to a template file:
sp_CustomProfileFieldsDisplay($name, $spPostUser->ID);
which users avatar??? the avatar is displayed in many locations...
again on the user id, it depends... if you do not supply the user id, it will auto fill the id of the current logged in user... so if you just want the current user, that is fine... but if you are displaying it somewhere that is not current logged in user based, you need to supply it... and how you supply it depends on where you are using the custom profile field since we normally have a user id setup, but it will vary from location to location...
so for example, if you want it to show in the topic view page, for each post, under the users avatar in the post info section, it would be something like:
sp_CustomProfileFieldsDisplay($name, $spThisPostUser->ID);
if you were showing it under the avatar in the users profile, it would be
sp_CustomProfileFieldsDisplay($name, $spProfileUser->ID);
of course, for both, you need to replace the $name with the field name...
so did I guess one of the avatar locations? if not, please specify which one...
Visit Cruise Talk Central and Mr Papa's World
You guessed both.
Ok, so I have tried and this and I am not getting the field to display. For the topic view I went to
spTopicView.php
and inserted the following
sp_CustomProfileFieldsDisplay($name, $spThisPostUser->ID); and I changed "name" to the corresponding field
I inserted that tag right after the following line:
sp_PostIndexUserName('tagClass=spPostUserName spCenter');
After doing that, I see no changes. Obviously I am doing something wrong.
can you please post exactly what you are entering here please... would like to check the syntax...
Visit Cruise Talk Central and Mr Papa's World
"test" is the name of the custom field when I created it.
>>>>>>Does it resolve to the item name needed? And why not just put that in quotes? Why use a variable?
I have no idea, I don't code at all. I am just following the instructions from the codex.
See the attached screenshot. I created a textarea that is viewable when you edit your profile and added the word "test" to the text area. I added the code exactly as you see in the above example in the hope that it would render under the avatar but no such luck.