XF 2.1 Display results question

Ozzy47

Well-known member
Okay, in my table I have a column called, username1 in this column there are three different items that could be in there. They are password_security, email_security and address_security.

Now in my template, normally to display results I would use <xf:cell>{$result.username1}</xf:cell>

Which works, but it returns the exact results, password_security, email_security and address_security.

How would I in my template use a if statement to change the display from the actual result to a different phrase depending on the result?
 
Untested...
Code:
<xf:if is="$result.username1 == 'password_security'">
   {{ phrase('password_phrase') }}
<xf:elseif is="$result.username1 == 'email_security'" />
   {{ phrase('email_phrase') }}
<xf:else />
   {{ phrase('address_phrase') }}
</xf:if>
 
Last edited:
Back
Top Bottom