Ad after first post - which template?

Diablotic

Active member
Which template should I use to insert my code that would display ad after first message (outside first message) in the way it looks like it is another post.
I have my code ready but I cannot figure into which template I should insert it to.
 
... just between posts 3 and 4.

Now wanting to create a new thread, I wanted to ask a question related to your point.

How would be the code to have an ad which is between post 1 and post 2.

The code below (on ad_message_below template), only places the ad inside the message container in bottom of post 1,

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

Thanks.
 
It turns out the ad_message_below template was included within the first message container, so the ad unit would still look like it is part of first post.

All one has to do is take it outside the list item <li> (message container). So for anyone who has a similar issue, here's the simple change

In message template find:

Code:
    <xen:hook name="message_below" params="{xen:array 'post={$message}','message_id={$messageId}'}" />
    <xen:include template="ad_message_below" />
</li>

Replace it with:
Code:
    <xen:hook name="message_below" params="{xen:array 'post={$message}','message_id={$messageId}'}" />
</li>
    <xen:include template="ad_message_below" />

I ended up creating a new template, using @Brogan conditional statements and including it on bottom of the message template ( <xen:include template="my_custom_template" /> ).

The example above is the overall idea behind having an ad unit which is between first and second message containers.

End Result:xen-1st-2nd.webp
 
Top Bottom