1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Need Help with Conditional

Discussion in 'Styling and Customization Questions' started by howarde, Jan 16, 2016.

  1. howarde

    howarde Member


    I'm working on a conditional, with two parts, and they both work as individual conditionals, but when I join them, it's not working.

    Here's what I want to do. If the user is in a group, and has their custom field set to "NO" then... else.

    <xen:if is="{$visitor.customFields.display_ads_for_supportin} == 'no' AND !{xen:helper ismemberof, $visitor, 58}">
    Do Stuff and block ads
    <xen:else />
    Do stuff with ads

  2. Brogan

    Brogan XenForo Moderator Staff Member

    How have you set up the custom user field?

    If it is a checkbox, the syntax would be:
    <xen:if is="!{$visitor.customFields.display_ads_for_supportin} AND {xen:helper ismemberof, $visitor, 58}">
  3. howarde

    howarde Member

    It's actually a select field, it takes "Yes" or "No" In hindsight, it probably should have been a checkbox, but I didn't set it up. It's been there a long time.
  4. howarde

    howarde Member

    Is there a way to do what I want, or do I have to change it to a checkbox somehow?

Share This Page