Posted February 13, 20205 yr 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!!
February 18, 20205 yr 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.
February 18, 20205 yr Author Thanks @Makoto. If I decide to go ahead with this, I'll reach out to you for a quote...
February 18, 20205 yr 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:
February 18, 20205 yr 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!
February 18, 20205 yr Author 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.... 😩
February 18, 20205 yr Yeah. Then you need custom plugin - I may do that for you. Edited February 18, 20205 yr by DawPi
February 18, 20205 yr 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' ) )
February 18, 20205 yr 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 🙂
February 19, 20205 yr Hello, My application has additional "helpers" {{ !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_club'])}} Show advert on all pages except clubs {{endif}}
February 24, 20205 yr Author Thanks @TDBF. This looks perfect. Question, will it work with standard IPS advertisements? Thanks again!!
February 24, 20205 yr 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. Edited February 24, 20205 yr by TDBF
Archived
This topic is now archived and is closed to further replies.