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

XF 1.5 Conditional - At least X messages per page

Discussion in 'XenForo Questions and Support' started by Russ, Nov 9, 2015.

  1. Russ

    Russ Well-Known Member

    So I'm showing content after the first post on every page, that's fine.

    What I need to do as well is show additional content above the bottom page nav only if there's at least 1 reply (so that a single post thread won't show both ads)

    This conditional works good inside thread_view template:

    Code:
    <xen:if is="{$thread.reply_count} > 0">
    
    Except when you get to a page in a multi-paged thread where it has a single post on it. So is there an additional conditional to check if a page of the thread has at least 2 posts on it?

    Problem:
    Screenshot_1.png



    Ideally how it should show:
    Screenshot_2.png

    Thanks... I'm awful with conditionals.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    It'd just be something like this:
    Code:
    <xen:if is="{xen:count $posts} > 1">
    That would show the ad if there is more than one post on the current page.
     
    Russ likes this.
  3. Russ

    Russ Well-Known Member

    Thanks Chris, works perfect :)
     

Share This Page