Giray Posted February 13, 2020 Share 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!! Link to comment Share on other sites More sharing options...
Makoto Posted February 18, 2020 Share 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. Link to comment Share on other sites More sharing options...
Giray Posted February 18, 2020 Author Share Posted February 18, 2020 Thanks @Makoto. If I decide to go ahead with this, I'll reach out to you for a quote... Link to comment Share on other sites More sharing options...
DawPi Posted February 18, 2020 Share 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: Link to comment Share on other sites More sharing options...
Daniel F Posted February 18, 2020 Share 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! Link to comment Share on other sites More sharing options...
Giray Posted February 18, 2020 Author Share 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.... 😩 Link to comment Share on other sites More sharing options...
DawPi Posted February 18, 2020 Share Posted February 18, 2020 Yeah. Then you need custom plugin - I may do that for you. Link to comment Share on other sites More sharing options...
Daniel F Posted February 18, 2020 Share 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' ) ) Link to comment Share on other sites More sharing options...
Makoto Posted February 18, 2020 Share 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 🙂 Link to comment Share on other sites More sharing options...
DawPi Posted February 18, 2020 Share Posted February 18, 2020 As I said. Link to comment Share on other sites More sharing options...
newbie LAC Posted February 19, 2020 Share 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}} Link to comment Share on other sites More sharing options...
TDBF Posted February 24, 2020 Share Posted February 24, 2020 Updated to allow disable or enable adverts on clubs and many other pages. Link to comment Share on other sites More sharing options...
Giray Posted February 24, 2020 Author Share Posted February 24, 2020 Thanks @TDBF. This looks perfect. Question, will it work with standard IPS advertisements? Thanks again!! Link to comment Share on other sites More sharing options...
TDBF Posted February 24, 2020 Share 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. Link to comment Share on other sites More sharing options...
Giray Posted February 24, 2020 Author Share Posted February 24, 2020 Lifesaver! Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.