Active
Project:
Content Injector (formerly AdSense Injector)
Version:
6.x-2.7
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2011 at 21:27 UTC
Updated:
18 Jul 2011 at 01:57 UTC
1.Wondering if there is a way to restrict this ad injection on a node body by theme OR print in the node.tpl
The reason for this is we are using a sub theme for our mobile users and having this print on the selected node body in our mobile theme does not fit within the mobile theme as it does in the regular theme.
2. In the node list area is there a way to limit the number of ads shown so for instance on a node teaser page showing ads between every node when their are several on a page can appear a bit cluttered.
1. Is the most important however. Thanks for a nice module.
Comments
Comment #1
mcurry commentedThere is no way to do #1 or #2 at present.
I will consider adding this capability to a future release.
Community: Please chime in. Do you want these features?
As always, patches to implement these features are encouraged and welcome.
Comment #2
venusrising commentedWell, please keep us in the loop as I would be happy to test. Bummer we can no longer use this module due to this fact.
Comment #3
mcurry commentedOn one of my sites, I use client-side JavaScript (contained in the insertion template) to inject mobile ads when a mobile browser is detected. Works like a charm. This works if you use an ad system that uses client-side JavaScript to insert ads (Google AdSense, for example).
In the Adsense Injector insertion template, we implement JS logic like this:
Comment #4
venusrising commented@mcurry We are using Mobile tools with Browsecap would such an implementation work with those i.e the if ...mobile. Yes we are using Adsense also.
Comment #5
mcurry commented@venusrising
I see no reason why it won't as long as you can insert ad code via JavaScript (which is how AdSense units are inserted normally, if you aren't using the AdSense module -- you just insert inline JS where you want the ads).
The technique is independent of theming or any Drupal module.
You can see it in action over at http://www.roadcarvin.com/product-review/fulmer-af-6b-review -- It's not the prettiest example but if you look at the page source you can see the JavaScript code that detects an iPhone (or iPod touch) browser and injects AdSense for Mobile units (it just uses a different ad unit). In this example, AdSense Injector isn't used with the [adsense ... ] tags; we just use a template that inserts raw AdSense JS code. That way, the client-side JS is doing all the work.
Again, not pretty, and AdSense Injector isn't really helping you in this case, but it gets you where you want to go.
-Mike
Comment #6
venusrising commented@mcurry We are using Adsense module.
I think it actually looks quite nice on your site. So you are not using a block to add the JS, just adding in in custom node.tpl? or did you a template variable and then call it in the theme? Thanks for your help and input.
Also,We are using Display Suite which has been handy and let you set node fields etc with Mobile Tools so you can have a filed print in a mobile view and not in a Desktop view.
Comment #7
mcurry commented@venusrising:
Thanks for the compliment.
In the AdSense Injector template (not in a .tpl file), we use JS to insert the appropriate ad channel. Here's the AdSense Injector template text:
(Actually, we run a custom version of AdSense Injector that allows insertion (N) paragraphs down the node body, so the above template has been changed to work with the released version of AdSense Injector, and it will inject the ad blocks at the top of the node body.)
So that's the only thing we needed to do. There is no other template modification needed. We don't use any other tricks. The is_iPhone() function is defined elsewhere, but that's a fairly trivial function.
The theming changes for iPhones is done purely in CSS, using a few nifty tricks. We don't use any theme-switcher modules or other Drupal mechanisms because they caused more problems than they solved, and were unnecessary as it turned out.
Comment #8
venusrising commented@mcurry WOW you are so very kind to share this, I know getting things to work can be hard work so I really appreciate your generosity.
BTW I love the text on the Fulmer helment that says "if you have a largish nose" what a kind way to put it, made me ROFLMAO!
Cheers
Comment #9
venusrising commented@mcurry I don't see any templates in adsense injector so I assume you mean the template within the admin.
Comment #10
mcurry commented@venusrising:
Right, there are no Drupal "templates" (files) for AdSense Injector. There are templates stored in the AdSense Injector Admin settings page. You can do everything you need (regarding the injection javascript) there.
I suppose I might want to change the terminology in the admin pages, since "templates" often have other meanings.
Comment #11
venusrising commented@mcurry Thanks for the info. If I make any headway limiting the adsense injector by theme I will let you know.
Comment #12
venusrising commented@mcurry Is it possible to show the add at the bottom of the node instead of top? I only see option of %body or %teaser in module code. This works so well, wish we could restrict this by theme. Thanks for sharing.
Comment #13
mcurry commented@venusrising:
Yep, just do this:
I hope that's what you wanted to know.
If you want to place ads elsewhere, you can use blocks or do custom theming in your theme templates. AdSense Injector can only inject stuff at the start or end of the node body or teaser.
Comment #14
venusrising commented@mcurry cannot believe we just had our adsense account disabled while using adsense module and adding an ad to our nodes.