<xen:if is="!in_array({$contentTemplate}, array('error', 'search_form', 'search_form_post', 'search_form_profile_post', 'xengallery_search_form_media', 'search_results', 'register_form', 'login', 'error_with_login', 'thread_view', 'cta_overtaking_index'))">
I use this:
Code:<xen:if is="!in_array({$contentTemplate}, array('error', 'search_form', 'search_form_post', 'search_form_profile_post', 'xengallery_search_form_media', 'search_results', 'register_form', 'login', 'error_with_login', 'thread_view', 'cta_overtaking_index'))">
Obviously there are some templates specific to my site and configuration there.
It's fine on my site and I've just used Brogan's code. It looks like you've included the code in the ad_above_top_breadcrumb template as the advert doesn't show on the login page but you've not added it to ad_below_bottom_breadcrumb as that is the advert that still shows.@Brogan - What are you using to stop adsense on the login page? I've tried the login template in the array, but it's still showing on my site?
I have them on above top breadcrumb, and below bottom breadcrumb. I'm testing the conditional on the top breadcrumb before applying it to the bottom one as well.It's fine on my site and I've just used Brogan's code. It looks like you've included the code in the ad_above_top_breadcrumb template as the advert doesn't show on the login page but you've not added it to ad_below_bottom_breadcrumb as that is the advert that still shows.
It's just the 404 pages that are still showing adverts.
The error pages don't use a template so there's no easy way of targeting them.Any idea why 'error' in the array isn't working in this case?
Hello @Brogan, did you find a way to stop ads on error pages ? Did something change regarding the templating ?The error pages don't use a template so there's no easy way of targeting them.
Code:<xen:if is="!in_array({$contentTemplate}, array('error', 'search_form', 'search_form_post', 'search_form_profile_post', 'xengallery_search_form_media', 'search_results', 'register_form', 'login', 'error_with_login', 'thread_view', 'cta_overtaking_index'))">
This is the most up to date, not sure if it's different in any way: https://xenforo.com/community/resources/responsive-adsense.2084/update?update=8093
---extra.css---
.error .banner-728-90 {
display: none;
}
<div class="banner-728-90">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- bredcrumb -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-00000000000"
data-ad-slot="0000000000"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
I have them on above top breadcrumb, and below bottom breadcrumb. I'm testing the conditional on the top breadcrumb before applying it to the bottom one as well.
It's not displaying when the URL ends in login, but for some reason, after the second attempt, it's showing login/login ?
http://www.z22se.co.uk/login/login
View attachment 56759
.login .banner-728-90 {
display: none;
}
<xen:if is="{xen:helper ismemberof, $visitor, 1, 84}">
<xen:if is="!in_array({$contentTemplate}, array('error', 'search_form', 'search_form_post', 'search_form_profile_post', 'xengallery_search_form_media', 'search_results', 'register_form', 'login', 'error_with_login', 'thread_view', 'cta_overtaking_index'))">
We use essential cookies to make this site work, and optional cookies to enhance your experience.