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

Template conditionals help

Discussion in 'Styling and Customization Questions' started by Andy.N, Nov 1, 2011.

  1. Andy.N

    Andy.N Well-Known Member

    I have a variable which is an array that holds the ID of all the tests that a member passed. I'm trying to find a way to display the highest test that the member passed so I can properly display the level they have achieved.

    The conditionals below are used in message_user_info template which I have been testing for a while but it seems like if a user pass quiz {11, 13, 15, etc}, it will only check that they pass the first quiz and exit the if loop. If the user passed quiz {11,13}, it should display "C++ level 3"

    Code:
    <xen:if hascontent="true">
    <ul class="ribbon">
    <xen:contentcheck>
                            <xen:if is="{xen:helper ismemberof, $user, 9} AND !{$user.qntquiz_passed.11}">
    <li class="ribbonPremium">
    <div class="left"></div>
    <div class="right"></div>
            C++ Level 1
    </li>
                        <xen:elseif is="{$user.qntquiz_passed.11}" />
    <li class="ribbonPremium">
    <div class="left"></div>
    <div class="right"></div>
            C++ Level 2
    </li>
    <xen:elseif is="{$user.qntquiz_passed.13}" />
    <li class="ribbonPremium">
    <div class="left"></div>
    <div class="right"></div>
            C++ Level 3
    </li>
                            <xen:elseif is="{$user.qntquiz_passed.15}" />
    <li class="ribbonPremium">
    <div class="left"></div>
    <div class="right"></div>
            C++ Level 4
    </li>
                            <xen:elseif is="{$user.qntquiz_passed.16}" />
    <li class="ribbonPremium">
    <div class="left"></div>
    <div class="right"></div>
            C++ Level 5
    </li>
                            <xen:elseif is="{$user.qntquiz_passed.17}" />
    <li class="ribbonPremium">
    <div class="left"></div>
    <div class="right"></div>
            C++ Level 6
    </li>
    </xen:if>
    </xen:contentcheck>
    </ul>
    </xen:if>
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. Andy.N

    Andy.N Well-Known Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    Will do.

    I just wanted to make both issues weren't worked on separately.

    I'll try and have a look later - just got in from my 10k run so need some carbs...
     
  5. Andy.N

    Andy.N Well-Known Member

    Sure thing Mr. Marathon man and Moderator.
    If you need an admin account to take a closer look, would be happy to supply via PC.
     
  6. Andy.N

    Andy.N Well-Known Member

    With the help of Jake Bunce (who else ;) ), we discover some disparity in the data that this variable collects. We will update when this is resolved.
    Thank you.
     
    Fuhrmann likes this.

Share This Page