Potential Human » drupal

Archive

Archive for the ‘drupal’ Category

Adsense without PHP in Drupal 6.2

April 16th, 2008 admin No comments

Login as user 1 (the administrator) and navigate to administer >> site configuration >> input formats. Add an input format, and name it whatever unique name you want. Drupal graciously allows for the assignment of roles for input formats. You can keep your users from displaying porn ads in your forums, and still retain the ability to post active content.

Now, the offending filter preventing adsense ads from displaying is the “HTML filter.” Enabling or disabling any combination of filters will allow adsense ads to properly display as long asĀ  “HTML filter” is turned off. The HTML filter carries this description:

“Allows you to restrict whether users can post HTML and which tags to filter out. It will also remove harmful content such as JavaScript events, JavaScript URLs and CSS styles from those tags that are not removed.”

Adsense ads are displayed via javascript. Go figure.

Translation: configure your format any way you want, just disable HTML filter, and assign roles carefully.

With this new input format enabled, you can post a google generated snippet anywhere and it should display properly.

By the way…I upgraded to drupal 6.2 since my last post on this topic, so this post may be irrelevant to 6.1 users. I simply don’t know, because I didn’t read the release notes.

Hope this is still helpful

Matt

Categories: drupal Tags: ,