Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This release is the second alpha release of the 6.x-3.x branch features (true in line content insertion using xPath expressions.)
First-time users
If you are using this module for the first time, you can install the module and start using it. Otherwise, please read on...
Upgrading from 7.x-1.x (or 6.x-1.x) versions
Before upgrading from 7.x-1.x (or 6.x-1.x) to this version, please make a copy of your node body insertion template and other settings. The module's configuration settings schema has changed, and your old settings will not be migrated automatically. You must edit and re-enter your node body insertion template.
If you are upgrading from 6.x-2.x versions, please read the known issues/installation notes, below!
MAJOR NEW FEATURES as of October 6, 2011
Now supports XPath-based insertion for inline ad insertion.
The default XPath expression is /html/body/p[3] which will insert the inline ad insertion template *after* the third paragraph of the node body, at the root level. This avoids insertion inside nested (descendant) elements.
At present, insertion is always done using ->appendChild() method of the element returned as a result of the XPath expression. This means that it's impossible to insert _before_ the found element. This limitation may be lifted in a future release.
"Top" and "bottom" insertion.
You can now specify "TOP" and "BOTTOM" insertion templates, which will be inserted at the top or bottom of the node body, respectively. This method uses the body's 'content' fields with weights (top = -6, and bottom = 10).
There is no way to alter these weights via the adsense_injector admin settings page, but you can set the variables 'adsense_injector_front_weight' and 'adsense_injector_back_weight' manually if you like. (Note: These variable names are likely to change in the future if and when these weights are exposed via the admin settings page.)
Manual (per-node) insertion point control.
Now supports manual insertion point selection (using a new [ai:insertion:inline] tag). The 'inline' template will be inserted at the point where this tag appears.
Manual blocking of injection on a per-node basis:
Now supports manual "no inject" (using the
comment or other occurance of 'ai:noinject' within first 512 characters of node body.)
Note that HTML comments are filtered out by the HTML filter and other filters, so you might need to use something like or any other HTML tag allowed by the node's input filter. (Oh, it would be so nice if Drupal's core HTML filter and HTML Corrector filter allowed HTML comments to pass through...)
See: #222926: HTML Corrector filter escapes HTML comments
and #103563: HTML filter escaping html comments
Removed AdSense module dependency.
That's right, you don't need the AdSense module to use AdSense Content Injector. If you don't have the AdSense module enabled, you won't be able to use the [adsense:xxx] tags in your templates. You can use raw JavaScript to inject Google AdSense ads. Your choice.
See: #1301610: Remove AdSense module dependency
If you are upgrading from 6.x-2.x versions, please read the known issues/installation notes, below!
MAJOR NEW FEATURES as of October 6, 2011
Now supports XPath-based insertion for inline ad insertion.
The default XPath expression is /html/body/p[3] which will insert the inline ad insertion template *after* the third paragraph of the node body, at the root level. This avoids insertion inside nested (descendant) elements.
At present, insertion is always done using ->appendChild() method of the element returned as a result of the XPath expression. This means that it's impossible to insert _before_ the found element. This limitation may be lifted in a future release.
"Top" and "bottom" insertion.
You can now specify "TOP" and "BOTTOM" insertion templates, which will be inserted at the top or bottom of the node body, respectively. This method uses the body's 'content' fields with weights (top = -6, and bottom = 10).
There is no way to alter these weights via the adsense_injector admin settings page, but you can set the variables 'adsense_injector_front_weight' and 'adsense_injector_back_weight' manually if you like. (Note: These variable names are likely to change in the future if and when these weights are exposed via the admin settings page.)
Manual (per-node) insertion point control.
Now supports manual insertion point selection (using a new [ai:insertion:inline] tag). The 'inline' template will be inserted at the point where this tag appears.
Manual blocking of injection on a per-node basis:
Now supports manual "no inject" (using the
comment or other occurance of 'ai:noinject' within first 512 characters of node body.)
Note that HTML comments are filtered out by the HTML filter and other filters, so you might need to use something like or any other HTML tag allowed by the node's input filter. (Oh, it would be so nice if Drupal's core HTML filter and HTML Corrector filter allowed HTML comments to pass through...)
See: #222926: HTML Corrector filter escapes HTML comments
and #103563: HTML filter escaping html comments
Removed AdSense module dependency.
That's right, you don't need the AdSense module to use AdSense Content Injector. If you don't have the AdSense module enabled, you won't be able to use the [adsense:xxx] tags in your templates. You can use raw JavaScript to inject Google AdSense ads. Your choice.
See: #1301610: Remove AdSense module dependency
- we skip 6.x-2.6 final release as sync with that of 5.x.
- reset system weight. (#123972: Adsense Injector and paging)
- simplify legacy _adsense_injector_count_words().
- simplify legacy _adsense_injector_minwords_cfg().
- simplify legacy _adsense_injector_count_words().
- simplify legacy _adsense_injector_minwords_cfg().
- #174705: bugfix ultra long variable name (admin setting need reset).
- remove fancy notice if no node type selected.
- bugfix list view based on previous code cleanup.
- cleanup variable names (admin setting need reset).
- default templates with new AdSense tag style.
- remove redundancy adsense module checking.
- adsense_injector_nodeapi() revamp for simpler programming logic.
- completely upgrade and port to D6.
- version number starting with 2.6 (sync with D5).
- tested with adsense 6.x-1.0-beta3.
- renew hook_menu(). D6 coming with new implementation.
- watchdog() no longer require for t().
- hook_nodeapi() coming with new implementation for D6.
- split admin related hook_settings() to adsense_injector.admin.inc, as D6 style.
- retouch adsense_injector.info so group this module with Adsense.
- coding style cleanup.
- validate code with coder module.
- add more documentation.
New template scheme allows insertion of ads before and/or after node body/teaser.
NOTE: if you've used a previous version of adsense_injector on your site, you will need to reset configuration values to the defaults and re-configure new template values. You should make a note of all your current configuration values before you install this version in order to assist in this process.
In particular, the teaser/list view template default is now:
New template scheme allows insertion of ads before and/or after node body/teaser.
NOTE: if you've used a previous version of adsense_injector on your site, you will need to reset configuration values to the defaults and re-configure new template values. You should make a note of all your current configuration values before you install this version in order to assist in this process.
In particular, the teaser/list view template default is now: