About Me

My Photo
k. novianto
Hello just call me Novi. Not like script and programing code, my life is simple. Thank you for visiting my blog. Enjoy
View my complete profile

Insert AdSense Ads Automatically in Drupal Nodes and Teaser Lists

Now you can Insert AdSense Ads Automatically in Drupal Nodes and Teaser Lists. Mike has write a module that tweaks a node's body or teaser to insert an inline AdSense ad, when a node is rendered on a full page or teaser list.

This is a powerfull AdSense Module. You can enable/disable the inserted AdSense with just a click of the mouse without need to edit each node. As an administrator, you will be allowed to enable automatic insertion 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 template.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 (which is the only way I can think of doing it if you are using inline filters).

The excellent AdSense module does most of the heavy lifting. Obviously, this requires that the AdSense module be installed, enabled, and configured correctly.

The site administrator has the following options:


  • Enable/disable insertion globally.
  • Select Ad format, channel, and group (as defined by AdSense module).
  • Edit template string for insertion - insert Adsense module tags, before or after body or teaser.

    This could be enhanced later to use templates or regular expression replacement capabilities.

  • Enable or disable insertion for individual node type(s).
  • NEW: set minimum node body "word count" threshold, below which the inline ads will not be inserted. This uses the same technique used by Drupal's node.module for minimum word count when submitting nodes (it just counts things separated by spaces, and doesn't adjust the count for HTML tags or any other markup). The module will insert HTML comments to help you see the word counts and limits (in case you think you should see an ad, but don't, or vice versa.) This limit is 'global' to all node types, but could be enhanced later to allow setting it on a per type basis.


Possible future enhancements

  • Repeated ad insertions after one or more paragraphs
  • Pattern matching, or other more sophisticated insertion strategy


Recent changes

  • Set minimum node body "word count" threshold, below which the inline ads will not be inserted. This uses the same technique used by Drupal's node.module for minimum word count when submitting nodes (it just counts things separated by spaces, and doesn't adjust the count for HTML tags or any other markup). The module will insert HTML comments to help you see the word counts and limits (in case you think you should see an ad, but don't, or vice versa.) This limit is 'global' to all node types, but could be enhanced later to allow setting it on a per type basis.
  • NEW: (1/7/2007) - Respects the Adsense module visibility settings - inserts only on pages that Adsense module will allow, based on the AdSense module's visibility settings.
  • NEW: (3/16/2007) - Insert ads in teaser lists (like the front page)
  • NEW: (3/16/2007) - Template-based insertion - define a template which can include any valid Adsense module tag, insert multiple ads, insert before and after body/teaser, etc.


Ok, this module has been approved to be hosted in the drupal.org CVS tree as an contributed module under the adsense module project.

This module has put to the Drupal project repository as adsense_injector.

For Drupal 6x, the only way I could get it to work was with a block. some one wrote how to did it on a blog here.

Reference:
- Exodus Development, Inc
- AdSense module


This blog is wearing Sederhana, a free XML Blogger Template adopted from Oh My Grid - WP theme by Thomas Arie
copyright 2008 - SOLO webdesign
email: soloweb.dev@gmail.com
phone: +6201329494035