There should be more choice for ads placements within posts

Numenorean7

Active member
Right now, you can include ads before or after posts, but it displays that ad unit in every single post. That's a lot. Did I miss something?

It would be nice if there were additional locations such as "first post", "second post", or "every 2 posts", etc. Does that make sense?

Thanks.
 

Chris D

XenForo developer
Staff member
You can just use template conditionals around your ad code to get a similar effect which, essentially, is the same thing you'd do in XF1. There are likely examples posted on the forum.
 

Numenorean7

Active member
You can just use template conditionals around your ad code to get a similar effect which, essentially, is the same thing you'd do in XF1. There are likely examples posted on the forum.
Thank you for your reply.

I tried the following code, but it didn't have an effect when I set it in my ad code using the XF2 advertisement manager. Did I miss something? Am I supposed to add the code directly in the template instead?

Code:
<xen:if is="{$post.position} == 0 AND !{$message.conversation_id}">
    Ad code
</xen:if>
Thanks!
 

Chris D

XenForo developer
Staff member
That's XF1 template syntax and won't work in XF2.

The equivalent would be:
Code:
<xf:if is="$post.position == 0">
    Ad code
</xf:if>
No need for the conversation_id check in XF2.
 
Top