Jump to content

Disable ads individual pages


IPBGallery.com
 Share

Recommended Posts

  • 8 months later...

@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

Edited by Peter Sowerby
Link to comment
Share on other sites

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. 

Edited by TSP
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...