Closed (duplicate)
Project:
Content Injector (formerly AdSense Injector)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2007 at 21:56 UTC
Updated:
14 Apr 2011 at 20:13 UTC
Comments
Comment #1
FiReaNGeL commentedI 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.
Comment #2
mcurry commentedParagraph 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...)
Comment #3
mcurry commentedAnd, 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.)
Comment #4
mcurry commentedFor 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.Comment #5
zoon_unit commentedAll good points.
Comment #6
mcurry commentedI'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
Comment #7
mcurry commentedComment #8
mcurry commentedMoving to 6.x dev, since 5.x is no longer supported.
Comment #9
mcurry commentedDuplicate of #141096: Inject adsense into content