Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
IPBGallery.com Posted November 11, 2015 Posted November 11, 2015 I need to disable the display of advertising on individual pages of the site. How to do it?
RooMac Posted August 5, 2016 Posted August 5, 2016 @EugeneZybov ACP > Themes > Edit HTML and CSS Templates > core > front > global > globalTemplate Find: {advertisement="ad_global_header"} Replace with following: {{if !(\IPS\Request::i()->app == 'core' and request.module == 'system' and \IPS\Request::i()->controller == 'register' or \IPS\Request::i()->controller == 'login' or \IPS\Request::i()->controller == 'lostpass' or \IPS\Request::i()->controller == 'page')}} {advertisement="ad_global_header"} {{endif}} This will disable the global header Ad on Register, Login, Lost Password and "Page". Here "Page" means that pages build using the Pages app. So, the key is this code: or \IPS\Request::i()->controller == 'register' Keep on adding this code one after the other and simply change the Real URL controller page syntax. You can find it under: ACP > Advanced Configuration > Friendly URLs The same goes for global footer Ads. Find: {advertisement="ad_global_footer"} Replace with following: {{if !(\IPS\Request::i()->app == 'core' and request.module == 'system' and \IPS\Request::i()->controller == 'register' or \IPS\Request::i()->controller == 'login' or \IPS\Request::i()->controller == 'lostpass' or \IPS\Request::i()->controller == 'page')}} {advertisement="ad_global_footer"} {{endif}} Cheers
pequeno Posted August 10, 2016 Posted August 10, 2016 Hello @Peter Sowerby, and in error pages, how to disable it? Thanks.
RooMac Posted August 10, 2016 Posted August 10, 2016 @pequeno If you could provide the full URL (copy from browser address bar) of the error page(s), that could be further looked into.
pequeno Posted August 11, 2016 Posted August 11, 2016 Can someone help me to disable ads in the "not found" error page from IPS? Error code. 1S160/2
TSP Posted August 12, 2016 Posted August 12, 2016 I don't think that's easily possible without installing a plugin to set some global variable when on an error page. A variable that you could then access in the templates. I tried a bit, but couldn't find a way to do it, and the code doesn't seem to provide a value someone can check either.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.