Template theming around Adsense blocks

budda - February 22, 2006 - 10:15
Project:AdSense
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:MadKad
Status:closed
Description

This patch adds two things to the current adsense.module

Theme Support

To add greater control to the look of a site featuring Google's AdSense i've added a new Drupal theme function.

Theme designers can now add additional HTML around the Adsense block as required.

This replaces the recent inclusion of a <div class="adsense">...</div> in the adsense.module

The benefit of the theming function is to add markup such as images above or next to the adverts, some consider this helps attract attention to the adverts.

The patch also implements some slight changes to the caching intelligence. Generated adverts are now no longer cached if the placeholders are in action. What's the point in caching the placeholder?

Filter

The filter system of Drupal caches processed text when nodes are saved to the database. Because of this the current Adsense filter failed if uid #1 was editing the nodes. All nodes would always show a placeholder.

This patch adds a switch when processing ads for the filter, so that the ad will always get generated.

The side effect is that uid #1, and anybody who has "hide adsense" permission WILL see the ads embedded in a node body.

There doesn't appear to be a way around this using the current Drupal filtering system.

Adsense in blocks will continue to operate as before, featuring a placeholder for uid #1 or anybody with "hide adsense" permission checked.

AttachmentSize
themeads.patch7.56 KB

#1

MadKad - March 15, 2006 - 17:44
Version:HEAD» 4.6.x-1.x-dev
Priority:normal» critical
Assigned to:Anonymous» MadKad

will this work on the 4.6.0 as i am having the same problem

#2

budda - March 16, 2006 - 10:20
Version:4.6.x-1.x-dev» HEAD

The patch I submitted was against the current CVS code. Please don't change the version tag.

I've not looked at 4.6 Adsense module, although you can probably back port my fix to 4.6.x

#3

dtmatthes - August 19, 2006 - 09:10

Do you have any plans to backport the patch to work with 4.6.x? I don't know how to do this. I believe that I'm experiencing an issue in 4.6.9 that would be fixed by the themeads.patch. When I insert an adsense tag into node content, the ads don't work until I go to the input formats settings and simply hit the "save configuration" button next to the adsense tag weight setting. I don't even need to change the weight setting. Thanks for your help.

#4

kbahey - August 19, 2006 - 14:00
Status:needs review» needs work

budda

This is a valuable patch, but is now out of date since adsense.module changed significantly.

Can you please re-roll it from the current HEAD or 4.7?

#5

dtmatthes - August 19, 2006 - 15:22

I found a workaround with my 4.6.x adsense issue. I just add adsense tags through the administer, content screen. If I edit a node through that screen and submit the changes, it doesn't show me the changes. It just goes back to the administer, content screen. This keeps the adsense placeholder box from getting cached while logged in as user 1.

#6

marcoBauli - December 8, 2006 - 12:53

howdy, i'm looking also for more themability,
and have as well some problems with style.css loading that could be connected with caching (?),

so bumping this, ty

#7

Darren Oh - December 8, 2006 - 19:48

The patch is too messy. Bumping the issue won't fix it. What is needed is a patch for the current code that just handles theming.

#8

Darren Oh - December 8, 2006 - 19:51
Title:Filter permissions fix & Template theming around Adsense blocks» Template theming around Adsense blocks
Version:HEAD» 4.7.x-1.x-dev
Category:bug report» feature request
Priority:critical» normal

#9

jcnventura - December 17, 2008 - 17:45
Version:4.7.x-1.x-dev» 6.x-1.x-dev
Status:needs work» active

This might be useful also in the new code..

#10

jcnventura - January 26, 2009 - 20:31
Status:active» fixed

I have just added some code to theme the div wrapper of the adsense ads. This will be in the dev version in a few hours.

The filter to prevent caching is unnecessary, as the new code doesn't use caching.

João

#11

System Message - February 9, 2009 - 20:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.