Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Giray Posted February 13, 2020 Posted February 13, 2020 Hi. Is there an easyish way to hide ads in clubs? I'm using the IPS advertisement system and wish to place the ads, for example, under the header but not in clubs. Thoughts? Thanks!!
Makoto Posted February 18, 2020 Posted February 18, 2020 In the core software there's no way to do this, unfortunately. But it wouldn't be too hard to code a plugin to make this work.
Giray Posted February 18, 2020 Author Posted February 18, 2020 Thanks @Makoto. If I decide to go ahead with this, I'll reach out to you for a quote...
DawPi Posted February 18, 2020 Posted February 18, 2020 On 2/13/2020 at 9:24 AM, Giray said: Is there an easyish way to hide ads in clubs? I'm using the IPS advertisement system and wish to place the ads, for example, under the header but not in clubs. Add something like this to the ad code: {{if \IPS\Dispatcher::i()->module->key != 'clubs'}} advert code {{endif}} Of course to make it work you must install this one:
Daniel F Posted February 18, 2020 Posted February 18, 2020 Keep I mind that only the club list, club index and member list use the club module, the club features( forums, topics, etc..) won’t use it!
Giray Posted February 18, 2020 Author Posted February 18, 2020 5 minutes ago, Daniel F said: Keep I mind that only the club list, club index and member list use the club module, the club features( forums, topics, etc..) won’t use it! Ouch. So that means that even if we remove the ad from the club list, it'll show in the topics, calendars, etc... right? Hmm.... 😩
DawPi Posted February 18, 2020 Posted February 18, 2020 Yeah. Then you need custom plugin - I may do that for you.
Daniel F Posted February 18, 2020 Posted February 18, 2020 Just now, Giray said: Ouch. So that means that even if we remove the ad from the club list, it'll show in the topics, calendars, etc... right? Hmm.... 😩 You’ll need to adjust the condition to take both scenarios into account. This should do it ( IPS\core\FrontNavigation::$clubTabActive or ( \IPS\Dispatcher::i()->application->directory === 'core' and \IPS\Dispatcher::i()->module->key === 'clubs' ) )
Makoto Posted February 18, 2020 Posted February 18, 2020 So you don't even really need a custom plug-in, looks like you can do this pretty easily with @newbie LAC's plugin and Daniel's little bit of template logic 🙂
newbie LAC Posted February 19, 2020 Posted February 19, 2020 Hello, My application has additional "helpers" {{ !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_club'])}} Show advert on all pages except clubs {{endif}}
TDBF Posted February 24, 2020 Posted February 24, 2020 Updated to allow disable or enable adverts on clubs and many other pages.
Giray Posted February 24, 2020 Author Posted February 24, 2020 Thanks @TDBF. This looks perfect. Question, will it work with standard IPS advertisements? Thanks again!!
TDBF Posted February 24, 2020 Posted February 24, 2020 3 minutes ago, Giray said: Thanks @TDBF. This looks perfect. Question, will it work with standard IPS advertisements? Thanks again!! Yes it works with IPS Advertisements. I wrote this because of Google Adsense complaining about not having access to parts of my site which were showing adverts.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.