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

XF 1.2 Ad Code on 10th Post in a Thread but Code in Header

Discussion in 'XenForo Questions and Support' started by akia, Feb 19, 2014.

  1. akia

    akia Well-Known Member

    I'm currently using:
    Code:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 10>
    to display a banner on the 10th post in a thread. which works fine.

    The problem I've got is not all threads have more than 10 posts in them, and I need something that I can use in the head of the page to wrap around the code that calls the ad, as I don't want to inflate my impressions where I've called for a ad but its not been displayed because there are only 5 posts in a thread.

    Is there a conditinal tag that I can use if there are more than 10 posts per page?

    I've tried
    Code:
    <xen:if is="{$contentTemplate} == 'thread_view' AND {$post.position} % {$xenOptions.messagesPerPage} == 10>
    but that dosn't work.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    $thread.reply_count
     
    akia likes this.
  3. akia

    akia Well-Known Member

    So in practice would that be:

    Code:
    <xen:if is="{$thread.reply_count} > 10>
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Yes :)
     
    akia likes this.
  5. akia

    akia Well-Known Member

    Thanks
     

Share This Page