Increase flexibility of adsense placement

zoon_unit - March 21, 2007 - 21:56
Project:Adsense Injector
Version:5.x-2.5
Component:Code
Category:feature request
Priority:minor
Assigned:Unassigned
Status:postponed
Description

Currently adsense injector is limited to placing ads at the beginning, end, and interface between teaser and body. As described earlier, other placement options are difficult due to the limitations of software to analyze paragraphs and image placement.

A simple and effective way to increase placement flexibility would be a tag. Create a comment tag similar to the break tag that allows the content creator to define the exact position of adsense placement. If no placement tag is found, adsense injector would default to the current placement option.

#1

FiReaNG3L - March 21, 2007 - 21:59

I think you can already do that with the default adsense module. The whole point of the Adsense injector module is to automate this :) I'm sure that paragraph analysis isn't that hard. Image placement could be a problem for some, of course.

#2

grateful_drupal_user - March 21, 2007 - 22:21
Priority:normal» minor

...I'm sure that paragraph analysis isn't that hard. Image placement could be a problem for some, of course.

Paragraph analysis may not be very difficult, but then, if adsense_injector has the feature, I need to expose an interface for specifying which paragraph(s), deal with errors, etc. - features multiply complexity (and support requests).

As I've said in other threads, I welcome any contributions of or links to a snippet of PHP code (a nice standalone function) that will *efficiently* and *reliably* pick apart a node body or HTML snippet at an arbitrary paragraph boundary (taking into account not just P tags, but Hn, BR, and all other tags that cause "paragraph" breaks.) This would be greatly appreciated and is likely to accelerate development of this feature. Until I have time to work up said code, I'm not going to fret over this too much, although I am considering it for a future release.

Perhaps an elegant regular expression will do the trick, but I haven't had time to deal with that.

Personally, I think that such a feature may open up a can of worms, but I will try to implement it at some point when I have the time - or, anyone is free to submit a patch (hint, hint!)

I think it's best to keep it simple right now. You can do some neat placement tricks using CSS, without worrying about counting paragraphs, etc. Let's play with the current scheme for a while and see what we can do with it. (If you haven't noticed, you can stuff anything you want into the insertion templates, which is both powerful and potentially dangerous...)

#3

grateful_drupal_user - March 21, 2007 - 22:25

A simple and effective way to increase placement flexibility would be a tag. Create a comment tag similar to the break tag that allows the content creator to define the exact position of adsense placement. If no placement tag is found, adsense injector would default to the current placement option.

And, from an efficiency standpoint, I'd rather not scan a node body for a tag on every node render operation... same goes for splitting on paragraph boundaries. Might not be a big deal, but then again, it could be. So in my opinion this needs to be avoided when the admin doesn't want to use such a feature (and incur the associated processing expense.)

#4

grateful_drupal_user - March 21, 2007 - 22:32
Title:Increase flexability of adsense placement» Increase flexibility of adsense placement

For the record, and if I recall correctly, the <!--break--> tags (and teaser creation) are processed during node creation and editing (the teaser and full body are stored separately in the DB so that this does not need to be done on very node render operation. One should consider why the Drupal design team chose that approach.

#5

zoon_unit - March 22, 2007 - 15:59

All good points.

#6

grateful_drupal_user - March 22, 2007 - 16:26

All good points.

I'm just thinking out loud... none of my points should be taken to mean I don't want to provide the feature. Just trying to go over all the issues in a public forum before I consider tackling the project. :D

#7

grateful_drupal_user - August 17, 2008 - 15:39
Status:active» postponed
 
 

Drupal is a registered trademark of Dries Buytaert.