Support Forum

showing the Custom Profile Fields

DH David H
David H
Member

Hi,

Happy new year.

 

I’m using Custom Profile Fields.

How can I show the fields in, for example, the published profile.

 

Thanks

 

David

 

8 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

I would start here: http://codex.simple-press.com/codex/plugins/our-plugins/available-plugins/custom-profile-fields/ – and then come back if you need more help with specifics…

DH David H
David H
Member

Thanks,

I looked for something like that…

 

I found this:

If you wanted to show the Custom profile display to the current logged in user then

1
sp_CustomProfileFieldsDisplay(
$name
,
$spTheUser
->ID);

To show the Custom profile display of a user in their profile pages you could use.

1
sp_CustomProfileFieldsDisplay(
$name
,
$spTheUser
->ID);
 

 

it is the same 

$spTheUser
->ID

Should it be like that?

because the second one is exactly what Im looking for, but it doesn’t work…

thanks

david

MP Mr Papa
Mr Papa
Member

not sure what you are doing – the code is messed up…   please be sure to paste in your code, select your code and use the code highlighter button – its the ${} button…

be sure to replace $name with the actual name of your custom field…

DH David H
David H
Member
screen-capture-115.jpg

OK,

Sorry that im not so clear.

The image above is from the link that  YELLOW SWORDFISH gave me before in this topic.

Maybe there is a mistake in the codes there, because it is the same code for two different things.

I need the second one which i think is wrong here.

Thanks

 

David

 

DH David H
David H
Member

I will try to explain it maybe better.

I want that if Mr A will look at the profile of Mr B he will see the Custom Profile Fields of Mr B.

 

:)
MP Mr Papa
Mr Papa
Member

you want:

sp_CustomProfileFieldsDisplay($name, $spProfileUser->ID)

but as mentioned, you have to replace $name with the actual name of your custom profile field, ie ‘my custom field’…

you may need some css or html too depending on where you show it in your profile display…  you add the tag to the profile popup or page template in your sp theme…

DH David H
David H
Member

Thank you very much… and I see that you have already changed it in the link… :)

I guess I’m the only one who use this… :)

If we are already here, these  template tags (I think you call them so) just give the custom field but not the name. They are surrounded by p html tags, and not like the sp_ProfileShowDisplayName for example, that surrounded by classes and so on.

Of course i can echo this html tags that I want in the template but is there a better way to do it?

 

thanks

 

David

MP Mr Papa
Mr Papa
Member

No, quite a few folks use it… yes, updated the codex since it was wrong – just not noticed before…

That is correct… you need to add any html and classes you need… keep in mind, if we did that by default, it would only work in that specific area of the profile… not all the profile (also remember there is a page display and a popup) areas have the same markup… and not all users display the info in that particular spot… I often create a new spot section for the custom data… we could have dozens of template tags for any possible area but that seems unwieldy…

> Simple:Press Support > Sunday, December 29, 2013 1:08 PM >postbox-contact.jpg