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

ismemberof error

Discussion in 'XenForo Development Discussions' started by Mythotical, Jul 9, 2012.

  1. Mythotical

    Mythotical Well-Known Member

    I am attempting to display specific information through template hooks, I had this working prior to 1.1.3 but now it errors out.

    This is my template:
    HTML:
    <dl class="pairsInline">
    <dt>Products:</dt>
    <dd>
    <xen:if is="{xen:helper ismemberof, $user, 8}">
    MyShop, 
    </xen:if>
    
    <xen:if is="{xen:helper ismemberof, $user, '9'}">
    MyReviews, 
    </xen:if>
    
    <xen:if is="{xen:helper ismemberof, $user, '11'}">
    MyClassifieds, 
    </xen:if>
    
    <xen:if is="{xen:helper ismemberof, $user, '13'}">
    MyListing, 
    </xen:if>
    
    <xen:if is="{xen:helper ismemberof, $user, '17'}">
    MyPoints, 
    </xen:if>
    
    <xen:if is="{xen:helper ismemberof, $user, '18'}">
    MyGallery (Alpha), 
    </xen:if>
    MyPortal, 
    MyNewsletter</dd>
    </dl>
    <dl class="pairsInline">
    <dt>Forum Expert in:</dt>
    <dd><xen:if is="{xen:helper ismemberid, $user, 1}">
    MyShop
    </xen:if>
    <xen:if is="{xen:helper ismemberid, $user, 2}">
    MyPoints, MyGallery
    </xen:if>
    </dd>
    </dl>
     
    DeltaHF likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That error means $user doesn't exist. Make sure that variable is available to your template.
     
  3. Mythotical

    Mythotical Well-Known Member

    How is that when it is in message_user_info?

    I checked that entire template and $user is available.
     
  4. Mythotical

    Mythotical Well-Known Member

    Ok I moved it directly into the template of message_user_info instead of doing a template hook and it worked, why won't it work using a template hook and including my own custom template?
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  6. Mythotical

    Mythotical Well-Known Member

Share This Page