Jump to content

Fetching Content of a Specific Custom Profile Field


Gesundheit
 Share

Recommended Posts

Hello,

How would I go about using template logic to get the value data from a specific custom profile field?

{{foreach $members as $member}}
  <li class='ipsPhotoPanel ipsPhotoPanel_tiny cAnnouncement'>
    {template="userPhoto" group="global" app="core" params="$member, 'tiny'"}
    <div>
      <h4 class='ipsType_large ipsType_reset'>{$member->link()|raw} </h4>
        {$member->groupName|raw}
        <ul class='cAuthorPane_info'>
          {template="customFieldsDisplay" group="global" app="core" params="$member"}
        </ul>
        <span class='ipsType_light ipsType_small'>{lang="widget_member_joined_date" htmlsprintf="$member->joined->html()"}</span>
          {{if $member->last_activity}}
            <br><span class='ipsType_light ipsType_small'>{lang="widget_member_last_active_date" htmlsprintf="\IPS\DateTime::ts( $member->last_activity )->html()"}</span>
          {{endif}}
    </div>
  </li>
{{endforeach}}

I'm assuming I need the right parameter for template customFieldsDisplay, but I can't figure it out.

@bfarber perhaps you can help? I checked your guide on 

, but it doesn't mention how to get content from a specific profile field.

Edited by Gesundheit
Link to comment
Share on other sites

  • 3 months later...
On 6/17/2020 at 2:17 PM, Gesundheit said:

How would I go about using template logic to get the value data from a specific custom profile field?

Have you found out how to get custom profile field data?

Here is a hint from customFieldsDisplay template:

{{foreach $author->contentProfileFields() as $group => $fields}}
	{{foreach $fields as $field => $value}}
	<li class='ipsResponsive_hidePhone ipsType_break'>
		{$value|raw}
	</li>
	{{endforeach}}
{{endforeach}}

 

Link to comment
Share on other sites

  • 1 month later...
 Share

  • Recently Browsing   0 members

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