This howto assumes that you already have an AdSense account and have your wiki set up to display AdSense ad units.
Let's say you need to place AdSense directly into your pages but don't want to have to past the AdSense module in every page. This how-to uses templates to place the AdSense module before and after specific sections of a page.
The Page
First, lets look at an example page, a pretty standard tutorial page. It has three sections, the introduction paragraph, the tutorial content, and the comments section. I'm going to assume you want to place ads in the most logical places — just after the introduction paragraph and just before the Comments module.
Each section should be separated by four or more equals signs (====).
====
Introductory Paragraph
====
Tutorial Content
====
[[module Comments title="Comment on This Tutorial]]
====
The Basic Template
Remember, _templates are applied to pages by category. If you want a specific set up for one kind of page vs. another kind of page, make sure to use different categories.
For tutorials, it's a good idea to use tutorial: as your category. Create your page using whatever category makes sense for the kind of page you are creating.
The URL to the template, for a tutorial, should look like this : yourwiki.wikidot.com/tutorial:_template
Here's the template :
%%content{1}%%
%%content{2}%%
%%content{3}%%
The _template will place the Introductory Paragraph in %%content{1}%%, the Tutorial Content in %%content{2}%%, and the section with the Comments module in %%content{3}%%.
NOTE : Make sure you use curly brackets { } instead of parenthesis ( ).
Creating Ads.
Note: Be careful. AdSense allows only 3 ad units per page. For example: If you use 2 units in templates, make sure that you have only 1 predefined ad unit.
Go to the AdSense control panel : https://www.wikidot.com/panel:adsense
Click on Configure Sites and choose your wiki from the list. This will take you to the Ad Unit panel.
In the Ad Unit Panel select Custom label for manual placement and type in a name for the ad unit. This name will be used in the AdSenseUnit Module you place in your page, such as:
[[module AdSenseUnit label="pages_banner"]] for the ad unit banners for banners. For a tutorial page, I'd recommend selecting text and image ads in Ad Type and 468 x 60 banner for the Format. You can go larger, but make sure to check it in IE 6 and IE 7 to make sure it fits. If it doesn't, all your content will be forced down below the side bar.
Adding Ads
Go back to your tutorial _template and include the AdSenseUnit module for the ad you just created.
%%content{1}%%
[[module AdSenseUnit label="pages_banner"]]
%%content{2}%%
[[module AdSenseUnit label="pages_banner"]]
%%content{3}%%
Click save and you will now have an AdSense ad unit below the Introduction Paragraph and above the Comments Module in every page you create using the tutorial: category.
Credits
This howto is written by hartnell