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

How can I show content in the first post in a thread, all pages?

Discussion in 'XenForo Questions and Support' started by Veer, Apr 14, 2011.

  1. Veer

    Veer Well-Known Member

    Hi, just needed little info related to the template syntax / conditionals

    I need to show some content in the first post in a thread, not only the first post but all pages too, all pages of a thread?

    Thanks.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Do you mean after the first post or in the first post?

    This is the conditional for after the first post:

    <xen:if is="{$post.position} == 0">
    This content will show after the first post
    </xen:if>

    Replace the first line with this for every page:

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
     
    Veer likes this.
  3. Veer

    Veer Well-Known Member

    I need to show in the first post on all thread pages.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    In that case, edit the ad_message_body template and add the following code:

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
    Your content
    </xen:if>
     
    Veer likes this.
  5. Veer

    Veer Well-Known Member

    Yes, it works, Thanks Brogan.
     
  6. Veer

    Veer Well-Known Member

    There's a problem, the content within the above code displays also on Conversation pages, that's irritating.
    How to fix it?
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Try this:

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
     
  8. Veer

    Veer Well-Known Member

    ah yes, it works.

    thanks a lot.
     

Share This Page