Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Custom Profile Fields: How to display labels?
Avatar
cebra
Member
Free Members
sp_UserOfflineSmall Offline
Jan 10, 2013 - 1:30 am

Hi,

I have used this code to integrate a custom profile  in spprofileshow.php:

sp_CustomProfileFieldsDisplay('Kamera', $spProfileUser->ID);

I do get the values, but *not* the field labels. What am I missing here?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 10, 2013 - 4:02 am

I believe you would need to display the label separately but I will take a look through the code as I am not sure why that would be...

andy-signature.png
YELLOW
SWORDFISH
Avatar
cebra
Member
Free Members
sp_UserOfflineSmall Offline
Jan 10, 2013 - 10:41 am

As the label can be changed in the backend.... well, it would be nice to grab it with one statement somehow. Please keet me updated that's the last thing I have to figure out.

Unless something new pops up :D

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 10, 2013 - 11:47 am

Yes - need to talk to Steve (Mr Papa) but he is not around until later tonight.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 10, 2013 - 7:42 pm

Okay, better explain a bit...  the label you define on the back end is for the profile edit form...  its for the profile users edit and enter a value for the custom profile field...  its mean to be descriptive so users know what the input field is for...  that label is not intended for display on other portions of the site (though it wouldnt hurt anything if you did)...  every where I have used custom profile fields, I have a completely different label on the form than on display...  the form is descriptive for editing but the display is short and sweet due to real estate limitations...

basically, there is two ways to get the a custom profile field data element...  you are using one method...  the second method is that it is also preloaded into the user object (reference by the slug)...  so if you custom field name was hometown, for example, you could get at it for a profile without the template tag by

$spProfileUser->hometown

but either way, the intention of the tag was for you to handle the outputting of a label to your liking... for example

echo 'Hometown: ';
sp_CustomProfileFieldsDisplay('hometown', $spProfileUser->ID);

Now we had looked at providing a label in the arguments to the template tag, but that became too limiting...  It was limiting because you can put the template tag just about anywhere... if we took the label as input, we would output it in one specific format...   and you would be restricted on how it looked... the profile and the user info area of topic view for posts, for example, is quite different... 

to say it more succinctly, putting it in the template tag would have forced appearance... letting you do the label gives you complete control...

hope that helps...

Avatar
cebra
Member
Free Members
sp_UserOfflineSmall Offline
Jan 11, 2013 - 2:48 am

wow, what an answer. Thanks a lot. I decided to simply duplicate a section in profileshow, edited the output variables and now have a nicely looking profile page.

I still think that for those who don't know how to do that it might be worth considering to let the plugin create just that: a new section on showprofile that displays the custom profile fields by default, maybe just be inserting a tag inside a defined place in the template.

Thanks for your help, Claus

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 11, 2013 - 9:09 pm

good work...  problem with making that the standard output is more folks are actually putting it in the user info section on topic view for each post..

but we can consider a couple of specific purpose built location tags and then maybe a general one...

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: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625