Closed (duplicate)
Project:
Content Injector (formerly AdSense Injector)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Apr 2007 at 15:50 UTC
Updated:
14 Apr 2011 at 20:05 UTC
Comments
Comment #1
mcurry commentedSorry, no way to do it with the current version. The problem is how does one ensure that the injected ad is placed correctly inside the body, not breaking any HTML tags or other markup - this is a non-trivial issue. I think the injected ad needs to be placed outside of all HTML tags in order not to break a page's content and markup.
I'm not arguing against the feature (which I would love to have as well) but I won't implement it until I know it won't break a site's content.
Perhaps in some future release...
Comment #2
udijw commentedThanks anyhow for the great module.
Comment #3
mcurry commentedSorry I can't help you right now - but please, rest assured, I am thinking about how to make this feature available... just not sure how to make it happen.
Comment #4
udijw commentedThis is just an idea (maybe foolish, dont be mad)
is there a way to place the block between teaser and body?
I mean the teaser has a clear ending of HTML, right - it must have one for the front page.
then you have the rest of the code.
do the code will look like
does it make sense?
Comment #5
mcurry commentedI appreciate your suggestions.
It's a nice idea. I've thought about it recently - but: I've seen Drupal end a teaser in the middle of HTML elements like blockquote, ul, etc - so, this technique probably won't guarantee anything - far from it.
All you have to do to see what I'm talking about is create a node with a single short sentence at the top then a large blockquote or ul section that goes on for 1000 characters (or whatever your default teaser length is.) The teaser is generated in the middle of the blockquote or ul section, which means... that the ad would be inserted in the middle of a blockquote or ul list - this is but one example - I could go on. The problem is that in general you should not insert the ad inside of any HTML element - it should fall outside of any markup element.
Consider the following node:
In my experience, Drupal's teaser generation does not look for the closing tag - it just cuts off the text at the appropriate character limit and uses that HTML snippet as a teaser.
Now, consider this node:
In my experience, the lists will be 'hacked off' and the teaser will consist of an incomplete node.
Feel free to paste these tests into your own site and see what it does with the teaser.
Rest assured that I've been thinking about this problem for months - inserting content inside of html and ensuring that it is well-formed is a non-trivial task - and I'm not quite ready to tackle it at this time. So I'm putting this thread 'to bed' - I don't really have time to dedicate to this problem right now.
Comment #6
mjh5598 commentedi read the string of comments, I was wondering if there was a way to insert the adsense ad after a certain amount of words in the article. If the article is not long enough..just drop the last 2 adsense ads at the bottom of the page. Can this be done ???? You can still use the right and left floating div... no ???
thanks
mjh
Comment #7
mcurry commentedDuplicate of #141096: Inject adsense into content
THis is an interesting (and frustrating) problem. I'm investigating solutions.
Comment #8
mcurry commentedMoving to 6.x dev, since 5.x is no longer supported.
Duplicate of #141096: Inject adsense into content