Downloads

Download adsense_injector-6.x-3.x-dev.tar.gztar.gz 15.77 KB
MD5: 380aa5df84c5dacfd0eb7c826c240b06
SHA-1: 4fad2b357a288180e34d1bb1056b193781dda8a0
SHA-256: 22077737bc83f05d56bdb5cba6112f09f8bfb38654dee37d48b4bf8b4c165669
Download adsense_injector-6.x-3.x-dev.zipzip 17.87 KB
MD5: aa1888fcfb1dd4c95f14ad1475a01cb4
SHA-1: a872083e37a2c2c476206e9e7e7c874a6d7c861e
SHA-256: 6672b86ba561f8556c7f983e4b5b82b0c02ba3a6bff5a4222c6600fff08aec88

Release notes

OVERVIEW

This version integrates a number of features I've been working on over the last year or so. It is intended to address issue #141096: Inject adsense into content and #1301610: Remove AdSense module dependency, and provide a platform for ongoing new feature development.

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

Installation notes and known issues

BEFORE YOU INSTALL THIS VERSION

If you've been using 6.x-2.x releases, you should disable node body insertion in page views before you upgrade to this version. This will allow you to update the module settings after you install the new version.

You will have to re-create your node insertion template. The template syntax has changed (%body token no longer available). Copy your old insertion template into a text editor before you install this version, remove the %body token, and update the template as needed.

The default inline insertion point is after the third top-level paragraph of the node (this is controlled by the inline insertion XPath pattern field.) You can change this by altering the XPath pattern. I will write up a handbook page about this soon.

Created by: mcurry
Created on: 6 Oct 2011 at 17:36 UTC
Last updated: 6 Jul 2016 at 20:22 UTC
New features

Other releases