Jump to content

Display profile field using template logic

Featured Replies

Posted

Hello,

I'm trying to display 200 characters of each member's About Me profile info on a HTML template that loops through all the members, however I cant seem to be able to display the info I want. Here's where I am:

{truncate="{$user->member()->['pfield_17']}" length="200"}

I'm obviously doing it wrong, I'm sure it is what you'd call a simple mistake, but guidance would be much appreciated.

Also, Using your correction, how could I show the a custom profile field with the ID number 23?

  • Author

Bump

  • 2 months later...

@F. John, have you found a solution? I also need to check for a custom profile field value to change settings on a page upon on the value. 

Found it! This one worked for me:

{{$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

  • No registered users viewing this page.