Jump to content

Pull custom profile fields in IP.Pages block


kotaco

Recommended Posts

Posted

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?
 

 

Posted

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 

  • 4 weeks later...
Posted

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. 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...