kotaco Posted February 9, 2016 Posted February 9, 2016 Hello, Does anyone know I would properly go about pulling specific custom profile fields within a block with IP.Pages. i.e. I want to display the 2nd and 3rd profile field but not the 1st and 4th, is there a template tag for this?
kotaco Posted February 11, 2016 Author Posted February 11, 2016 Update: for my purposes I got it working with this: I altered it to check to see if the field has content, otherwise returns "This member has not entered their Steam ID." which you can alter as needed. {{$fields = $member->profileFields();}} {{$steamid = $fields['core_pfieldgroups_1']['core_pfield_3']; }} {{if ( $location != '' )}} {$steamid} {{else}} This member has not entered their Steam ID. {{endif}} Change the number id's for core_pfieldgroups_X and core_pfield_X to change which field you are pulling. Alter $steamid to whatever suits your needs. Hope that can help somebody save time researching and more time building If you see something that can be done better please share
AKrasnov Posted March 9, 2016 Posted March 9, 2016 This one worked for me. Thanks! {{$fields = \IPS\Member::loggedIn()->profileFields();}} {{$gmHouseNumber = $fields['core_pfieldgroups_1']['core_pfield_1']; }} House Number: {$gmHouseNumber} House number is stores in a first custom profile field in a first group.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.