ads every x post

ehsanix

Verified Customer
#1
Hello
Is it possible to put banners every x posts? Or put banners after post 3 , 6 , 9 , 12 in each thread page?
I thought I can do this with the "Specific post order" in zone settings but I couldn't.
 

anthony parsons

Verified Customer
#3
Is it possible to put banners every x posts?
You can do it by embedding a zone into an XF template @ehsanix. Yes, it would be nicer if this could be done as a single zone from adserver though, picking post number x, y, z and all ads from zone x rotate through each respective chosen post.

Saying that... I am finding that using a zone for each post allows me to put higher performing ads above the fold, and decline ads down that get used, but aren't as profitable.
 

ehsanix

Verified Customer
#5
Thanks @anthony parsons
I did it this way a few days after my post here and it is working fine in this 9 months.
Edit template "post" and at the end of template add this:
Code:
<xen:if is="
{$post.position} % {$xenOptions.messagesPerPage} == 0 OR
{$post.position} % {$xenOptions.messagesPerPage} == 5 OR
{$post.position} % {$xenOptions.messagesPerPage} == 11 OR
{$post.position} % {$xenOptions.messagesPerPage} == 17
">
<div class="midpostads">
    <xen:hook name="everyXpostbanners" />
</div>
</xen:if>
Then add your custom hook name, that is in this example "everyXpostbanners" to the custom hook part of you zone and I selected the Mode : After

Of course you may customize this based on your style or the way you like to show banners. I have 20 posts per page and wanted to have 4 zones per full page.
 

anthony parsons

Verified Customer
#6
That is a very smart way of doing it, thanks... I will absolutely look into this.

Based on how mine are, floated left into the post content, I think I will wrap the default post XF hook in your code, then on the xf ad template insert the zone by itself. Not sure if that will work or not yet, but I like your code and will play around with it.
 
Last edited:
Top