How to Add Google AdSense to your TikiWiki site.
Please see: Module AdSense
General tip: when inserting javascript in a tpl, do not use the TikiWiki template editor to modify the tpl, the javascript will be stripped for security reason. You need to use an editor outside tikiwiki.
1- Create a file called templates/mygoogleadsense.tpl and paste the code provided by google. {literal} and {/literal} makes sure that any javascript code doesn't conflict with Smarty code.

{literal}
<!--
google_ad_client = "pub-00000000000000";
/* 468x15, created 06/02/08 */
google_ad_slot = "0123456789";
google_ad_width = 468;
google_ad_height = 15;
//-->
{/literal}2- Create a module
Name: mygoogleadsense
Title: Advertisment
Data: {include file="mygoogleadsense.tpl"}
3a You can assign that module, as usual
3b or include in a wiki page

{MODULE(module=>mygoogleadsense, decorations=>n)}{MODULE}[+] Tutorial from David Mattison
Javascript Alternative
Another alternative: use the smarty {literal} tag to "escape" the Javascript code from Google Adsense. This allows you to (nearly) simply cut/paste the code directly into a module.For example:
{literal}<{/literal}script type="text/javascript"><!--
google_ad_client = "pub-00000000000000";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel = "9238635124";
google_color_border = "006666";
google_color_bg = "EEF5EE";
google_color_link = "006666";
google_color_text = "000000";
google_color_url = "000000";
google_ui_features = "rc:6";
//-->
{literal}<{/literal}/script>
{literal}<{/literal}script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
{literal}<{/literal}/script>Note the use of {literal}<{/literal} to escape the Javascript SCRIPT element.
Contributors to this page: marclaporte
,
sylvie
,
ricks99
and
mlpvolt
.
Page last modified on Thursday 23 April, 2009 05:51:04 UTC by marclaporte
.
Sidebar
Featured links
To register
To have an account at this site, please register at Tikiwiki.org
, and then use that user name and password to log in here.
This site gets user information from Tikiwiki.org with the InterTiki feature.
This site gets user information from Tikiwiki.org with the InterTiki feature.