Welcome to Geeklog, Anonymous Tuesday, April 23 2024 @ 11:14 pm EDT

Geeklog Forums

disabling a block on certain screens


martingale

Anonymous
So I have an AdSense account and I put my ads in a left block. I experimented and for my site this location really is the best place for them.

Anyway, it is against the AdSense terms of service to show ads on a page without any content. They specifically mention login pages, registration pages, and the like. So I need a way to turn the AdSense block off when it's on a "non-content" page. Basically I want the ads to appear only on the main page, in the topic index, and next to any story, comment, or static page.

How can I do that?
 Quote

Status: offline

warren

Forum User
Chatty
Registered: 01/31/05
Posts: 41
go into your blocks admin page. Click on the block you want to change. You will have the option to enable the block on just the home page all the pages or just a certine topic. For addsence I would just put it on the home page that way you always have content and you do not need to register to see it.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
To have full control over when the block shows up, make it a PHP block. In you PHP code, you can then check what the current URL is and either return the contents of the block or return an empty string, in which case the block would not be displayed.

bye, Dirk
 Quote

martingale

Anonymous
I will do it as a PHP block I guess. It would be nice if there were more built-in control over where blocks appear. It would be nice if it were a multi-select list rather than a "pick one", and if it included the option to control whether it showed next to stories or not.

I bet I am not the only one here with AdSense in a block... I wonder if everyone else realizes if you show it on every page you violate the TOS.
 Quote

All times are EDT. The time is now 11:14 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content