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

XF 1.4 Ads between first and second post

#1
Hello

I have used this as refference to include my adsense banners https://xenforo.com/community/resources/visual-list-of-ad-locations.1383/ however I couldn't find anything about placing ads between first and second post.

The after first post threads that I've found like this one https://xenforo.com/community/threads/ad-after-first-post-which-template.17313/ places the banner too close to the post content and it's not what I want. A working example of adsense placed between first and second post of each thread: http://prntscr.com/9j6cq5 , as you see it's totally separated from the post content.

Also using <li></li> to wrap the adsense banner into a nice container with the ad_thread template (except ad_thread_view_below_messages which works fine) breaks the forum style, no matter what I'll do and blanks the second post of the thread.
 
#4
Thanks, I have already used the following conditional statement prior to opening this thread.

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

However as I have already mentioned the banner gets too close to the post content (acts like a signature) and I want to be separate between first and 2nd post just like in the screenshot I've posted as an example.
 
#6
Doing that already with a <li> but wraping it with the <li> tags breaks the design, second post turns into blank and the post height is changed to some big value.

Also I don't intend to make it look as a post as shown in your example.
 
Last edited:
#8
The only issue here is why the <li> tags are breaking the design when are added in the ad_message_below and I've seen there are quite a few people on xenforo having the same problem witht he li tags messing up the design when being added (this guy over here has it too https://xenforo.com/community/threads/ad-after-first-post-which-template.17313/#post-888554)

Alright, a workaround that I've did was to drop the <li> tags and create a new div container adding a margin-top in order to get the same effect I would get with <li> tags and seems to work fine.
 
Last edited:

Brogan

XenForo moderator
Staff member
#9
I don't have any issues using li tags.
I have also in the past inserted ads without them, again without any issues.

Perhaps it's an issue with your custom style, or the markup you are using.
 
#10
I will use this thread to put my question, if it's OK. I think it is related to it.

In a few words - I want to insert an ad spot in every single first post of a thread. Here is how it should look like:

Screenshot from 2017-02-11 23:30:17.png

Does someone already integrated that way? And if he does, would he give us an idea how? Any suggestions will be appreciated. :) Thanks in advance and hope to help me here.

All the best,
 

Dadparvar

Well-known member
#11
I will use this thread to put my question, if it's OK. I think it is related to it.

In a few words - I want to insert an ad spot in every single first post of a thread. Here is how it should look like:

View attachment 148015

Does someone already integrated that way? And if he does, would he give us an idea how? Any suggestions will be appreciated. :) Thanks in advance and hope to help me here.

All the best,
use this small addon and see how things work:
https://xenforo.com/community/resources/show-extras-in-thread-page.5021/
Anyway there is a great paid one too.
 
#12
use this small addon and see how things work:
https://xenforo.com/community/resources/show-extras-in-thread-page.5021/
Anyway there is a great paid one too.
Thanks a lot for your reply. I prefer to add this it in some of the templates, because I use Revive Adserver, and implementation is easy, just need to know where in the templates with some condition of course in order to be only showing in the first post. :) Any advice is welcome.not big fen of adding add-ons for every simple code adding. Thanks a lot once again. :)