XF 1.5 Values of Checkbox Custom Field in Template?

Gossamer

Active member
Hello! I'm trying to setup a conditional based off of a custom user field. But I'm having trouble just pulling the custom user field into my template. Other custom fields work fine. But I can't get a checkbox field to display.

I've been trying to just display the selected values of the checkbox field, but this isn't printing anything: {$visitor.customFields.merits}
 

Gossamer

Active member
I got it to display using this code:

{xen:helper userFieldValue, 'merits', $visitor, {$visitor.customFields.merits}}

Now I'm trying to use an if statement that checks if that checkbox custom field has a specific option checked.
 

Gossamer

Active member
Figured it out!

Code:
<xen:if is="{$visitor.customFields.merits.Psychic}">
    Psionics Test<br>
</xen:if>
<xen:if is="{$visitor.customFields.merits.Thaumaturgy}">
    Thaumaturgy Test
</xen:if>
 
Top