PDA

View Full Version : Custom User Fields


Kirsch
11-10-2015, 04:25 AM
I am trying to display custom user fields on the profile page using this script:
<vb:if condition="!empty($userInfo['customFields']['default']['field2_title'])"><div class="profile-info-item">{vb:phrase location}: {vb:raw userInfo.customFields.default.field2_title.val}</div></vb:if>

So that the profile would display something like "Location: USA"

However, when there is no value in the text box, it still displays "Location:"

Is there a way to fix the code so that the title and information are only shown on the profile if there is a value in the text box?

Thanks in advance!

Lynne
11-10-2015, 04:41 PM
Why not just:

<vb:if condition="$userInfo['field2']"><div class="profile-info-item">{vb:phrase location}: {vb:raw userInfo.customFields.default.field2_title.val}</div></vb:if>