Jump to content

  •  

- - - - -

4.3 Template Syntax question


  • Please log in to reply
1 reply to this topic

#1 theedeer

theedeer

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 10 October 2018 - 01:32 AM

I am trying to add an image if a users contentProfileFields() contains "Leadership", how would I go about checking if contentProfileFields() contains that string within it?

#2 seventeen82

seventeen82

    Advanced Member

  • Member
  • PipPipPip
  • 35 posts

Posted 11 October 2018 - 11:09 AM

Where are you trying to display it? If member is a member? Or like for comment author?

Try something like this :
{{$member = \IPS\Member::loggedIn();}}
{{$fieldData = $member->ProfileFields()['core_pfieldgroups_<group_id>']['core_pfield_<field_id>'];}}
{{if $fieldData === 'Leadership'}}
<img>
{{endif}}

Edited by seventeen82, 18 October 2018 - 09:13 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users