N Neutral Singh Well-known member Oct 19, 2017 #1 How can I show adsense within first and/or last post of every page like this: The message should seamlessly adjust along the sides of the adsense block... Last edited: Oct 19, 2017
How can I show adsense within first and/or last post of every page like this: The message should seamlessly adjust along the sides of the adsense block...
Optic Well-known member Oct 19, 2017 #2 Hi @Neutral Singh As a starting point.. Place it in ad_message_body template: https://xenforo.com/community/resources/visual-list-of-ad-locations.1383/ Then wrap using a template conditional: https://xenforo.com/community/resources/conditional-statements.1604/ First post: Code: <xen:if is="{$post.position} == 0 AND !{$message.conversation_id}"> code </xen:if> or Last post: Code: <xen:if is="{$post.position} == {$thread.reply_count}"> code </xen:if> You'll probably need to use CSS to float the ad to the right too. Maybe others can help too - have not placed an ad in that position before. Upvote 0 Downvote
Hi @Neutral Singh As a starting point.. Place it in ad_message_body template: https://xenforo.com/community/resources/visual-list-of-ad-locations.1383/ Then wrap using a template conditional: https://xenforo.com/community/resources/conditional-statements.1604/ First post: Code: <xen:if is="{$post.position} == 0 AND !{$message.conversation_id}"> code </xen:if> or Last post: Code: <xen:if is="{$post.position} == {$thread.reply_count}"> code </xen:if> You'll probably need to use CSS to float the ad to the right too. Maybe others can help too - have not placed an ad in that position before.
N Neutral Singh Well-known member Oct 19, 2017 #3 Thank you! To show adsense block on every page, i used the following code: Code: <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}"> Can't figure out how to show adsense on the last post of every page. So, i have reached this stage: Now, how can i twist the CSS to show the block as desired in my first post. Thank you Upvote 0 Downvote
Thank you! To show adsense block on every page, i used the following code: Code: <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}"> Can't figure out how to show adsense on the last post of every page. So, i have reached this stage: Now, how can i twist the CSS to show the block as desired in my first post. Thank you