Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
showing the Custom Profile Fields
Avatar
David H
Member
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 2:51 am

Hi,

Happy new year.

 

I'm using Custom Profile Fields.

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

 

Thanks

 

David

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 29, 2013 - 3:30 am

I would start here: http://codex.simple-press.com/.....le-fields/ - and then come back if you need more help with specifics...

andy-signature.png
YELLOW
SWORDFISH
Avatar
David H
Member
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 8:30 am

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

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 12:59 pm

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...

Avatar
David H
Member
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 2:16 pm

screen-capture-115.jpgImage Enlarger

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

 

Avatar
David H
Member
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 2:19 pm

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.

 

:)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 3:12 pm

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...

Avatar
David H
Member
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 4:08 pm

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

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 29, 2013 - 4:47 pm

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

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626