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

XF 1.1 How do I add a single Ad within the 1st post only, in a thread?

#3
Great!
For future reference (maybe it can help someone with the very same question of mine?), this is how I solved it:

Code:
<xen:hook name="ad_message_body" />
<xen:if is="{$post.position} == 0 AND !{$message.conversation_id}">
<div style="display: block; float: right; vertical-align: middle">
 
// here it goes my code
 
</div>
</xen:if>
Thanks Brogan, really appreciate your help
Marco
 

Marco Famà

Active member
#7
ciao Brogan,
is there another way to edit the following code

Code:
<xen:if is="!{$message.conversation_id} AND !{$ajaxInsert} AND {$post.position} == 0">
to make something appear only in the first post of each page?
If I remove the AND {$post.position} == 0 the banner gets replicated into ALL posts, and I'm not sure I understood why

Can you please help Brogan/all?

Thanks!
Marco
 
#10
http://xenforo.com/community/resources/conditional-statements.1604/

How can I show content after post x on every page in a thread?
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x AND !{$message.conversation_id}">
This content will show after post x on every page in a thread
</xen:if>
hey Brogan
do you know if a conditional statement to check which browser the user is navigating forum froms, is available? Tried searching your link with no result... can you please help?

Thanks
Marco