• 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?

Veer

Well-known member
#1
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.
 

Brogan

XenForo moderator
Staff member
#2
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">
 

Brogan

XenForo moderator
Staff member
#4
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

Well-known member
#6
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>
There's a problem, the content within the above code displays also on Conversation pages, that's irritating.
How to fix it?
 

Brogan

XenForo moderator
Staff member
#7
Try this:

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