1. 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

Discussion in 'XenForo Questions and Support' started by Adrian D., Dec 27, 2015.

  1. Adrian D.

    Adrian D. Member

    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.
     
  2. AndyB

    AndyB Well-Known Member

  3. Brogan

    Brogan XenForo Moderator Staff Member

    Amaury and Liam W like this.
  4. Adrian D.

    Adrian D. Member

    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.
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

  6. Adrian D.

    Adrian D. Member

    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: Dec 27, 2015
  7. Brogan

    Brogan XenForo Moderator Staff Member

    You don't need to use li tags.

    Just use the html and css you want to achieve the effect you want.
     
  8. Adrian D.

    Adrian D. Member

    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: Dec 27, 2015
  9. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     

Share This Page