Adsense Injector

Here's a useful Drupal module that works with the excellent Adsense Module to insert an adsense ad before or after a node's content when a node is rendered on a full-page or teaser view.

This allows site administrators to enable automatic injection of an adsense ad into the page without the content editor having to insert inline [adense] filter tags, or having to edit a site's node.tpl.php (or other template) files. This offers a big advantage, as you can change the ad format, group, and channel on the fly without hand-editing each node.
You can see it in action at http://exodusdev.com/drupal/4.7/modules/adsense_injector.module
New feature (3/17/07 - 2.5 release) - Better control of placement (before or after node body or teaser).
New feature (2/10/07) - Now can insert ads in frontpage, taxonomy, and other teaser-type lists.

I created this module because I wanted a simple and reliable way to insert inline ads at the top of node content ('above the fold') only when the user views the full node - not when the node teaser (or full node) is shown in a list or front page, for example.

Other features:

  • Admin-defined word count threshold - only inserts ads if node body has more than the chosen # of words (using the same method as node.module to determine wordcounts).
  • Obeys Adsense Module visibility settings - shows ads only where allowed by the Adsense Module visibility settings.
  • Administrator can control the injected content - use inline styles, or use stylesheet styles to control presentation.
  • Insert ads in frontpage and taxonomy (teaser) lists.
  • New template scheme allows insertion of ads using adsense module tags (filter tags) as well as insertion of multiple ads and positioning at front and/or end of node body or teaser.

Dependencies: Adsense Module must be installed, enabled, and correctly configured prior to using this module.

This module does not create or modify any database tables.

Releases

Official releasesDateSizeLinksStatus
5.x-2.5-12007-Apr-069.54 KBRecommended for 5.xThis is currently the recommended release for 5.x.
4.7.x-2.5-12007-Apr-069.15 KBRecommended for 4.7.xThis is currently the recommended release for 4.7.x.
 
 

Drupal is a registered trademark of Dries Buytaert.