Closed (fixed)
Project:
Google AdSense integration
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Aug 2013 at 14:29 UTC
Updated:
19 Mar 2014 at 00:24 UTC
Jump to comment: Most recent
Comments
Comment #1
jcnventuraHi Jonathan,
Replying to your points:
1. Do NOT delete the file.. The objective of that file is to make sure that the standard drupal block naming conventions are not applied to the block. This is because the most popular ad-blocking lists contain a rule that targets any #block-adsense_managed* blocks, and prevent the display of that whole block. Even if it contains only the experimental 'please disable ad blocking on this site', request. If you've modified block.tpl.php in your theme, I think you can also create a theme-specific block-adsense_managed.tpl.php file.
2. Not a typo.. In my test envs, this effectively appends an underscore to the module name. So "adsense_managed" becomes "adsense_managed_". Which does not match any of the ad-blocking rules. However the proper way to do this is to use {$module}_ since the underscore can also be part of the variable name. As it works in my envs it doesn't seem critical but I'll fix it soon(ish).
3. My bad. I tried to remove the inline styles in that function and move them into a CSS file. That didn't work because the css file was being ad-blocked. So I reverted back to inline styles and got rid of the CSS file, but never changed the class to the previous definition. I'll re-add the simple adsense in addition to the placeholder class.
João
Comment #2
jonathan1055 commentedHi, thanks very much for your answers. I was unaware of all the ad-blocking work you have done, and now I see why you have changed things.
class='adsense $module_'I get just class='adsense ' whereas you say that because $module is 'adsense_managed' you get class='adsense adsense_managed_'. Are you really sure?Thanks again for your explainations, and for doing great work on the module.
Jonathan
Comment #3
jcnventuraHi Jonathan,
Yes, I'm sure about it. We probably have different PHP versions.. I'll keep this open until I do the minor modifications that I indicated in points 2 and 3.
João
Comment #4
muckermarc commentedHi,
I have a similar issue with this module, in that I need to style up the blocks, so ideally I'd like a class attribute in the block div tag.
Based on this comment, I figured I could copy block-adsense_managed.tpl.php into my own theme, and edit the file to drop in an extra class attribute:
But despite clearing the theme registry, it doesn't seem to pick up my template file and reverts to the original block-adsense_managed.tpl.php. So for now, I've had to edit the original block-adsense_managed.tpl.php, but this isn't ideal.
Any ideas on why the template over-ride aint working?
Thanks,
Marc
Comment #5
jcnventuraYour theming setup probably doesn't work to theme other blocks as well. However it's also possible that the hook_theme_registry_alter() needs to be improved.
Can you try to make sure you can theme other blocks?
Comment #6
jcnventuraPoint 2, is now moot as {$module}_ is now blacklisted also.
Solved point 3: http://drupalcode.org/project/adsense.git/commit/43f5e90
Comment #7
jcnventuraNo further info in more than two weeks. Closing the issue.
Comment #8
jonathan1055 commentedThanks for the info.