Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 11, 20159 yr I need to disable the display of advertising on individual pages of the site. How to do it?
August 5, 20168 yr @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
August 10, 20168 yr @pequeno If you could provide the full URL (copy from browser address bar) of the error page(s), that could be further looked into.
August 11, 20168 yr Can someone help me to disable ads in the "not found" error page from IPS? Error code. 1S160/2
August 12, 20168 yr 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.
Archived
This topic is now archived and is closed to further replies.