DasBlog Extension for Google AdSense#

Currently it is not much, but I already was asked how I added Google AdSense into my blog, which is based upon DasBlog. As far as I know, DasBlog offers no direct way to add an element only once between the feeds. Google AdSense limits you to three (I think) ad-areas per page, so adding the AdSense after every post is way too much and guarantees your removal from the AdSense program.

For now, I'll simply offer my macro for download and you can use it as you will. It is fairly easy to implement into your templates. To get it working, you have to edit the web.config file of your DasBlog. If you have not done so, you'll have to uncomment the settings for using macros and you have to instert a node for my macro in the newtelligence.DasBlog.Macros section.

<CONFIGSECTIONS>
        <SECTION type="newtelligence.DasBlog.Web.Core.MacroSectionHandler, newtelligence.DasBlog.Web.Core" name="newtelligence.DasBlog.Macros" requirePermission="false" />
        [...]
</CONFIGSECTIONS>

[...]

<NEWTELLIGENCE.DASBLOG.MACROS>
        <ADD type="MyGoogles.MyGoogleMacros,MyGoogles" macro="MyGoogleMacros" />
</NEWTELLIGENCE.DASBLOG.MACROS>

You need to download my macro (2 KB) and copy it into your DasBlog-bin folder. Now you are up and running. Open your template for your blog and insert the following line (customize the location of the file) for inserting any file content at the position.

<%IncludeContentOnce("C:\Webs\Site\Blog\Content\GoogleAdSense.txt", "ContentAdSense")|MyGoogleMacros%>

You can add multiple content this way, it will load the file and output its content straight into the expected position. The second parameter is a simple identifier which will allow you, when change, to add multiple different contents into your blog. I'll update this function soon to take more parameters allowing you to further control the contents position within the list of feeds.

The nice thing about creating macros for DasBlog is, that it is straight forward and easy. From first finding out abou macros to finally implementing a working solution it took me less than 15 minutes.

Thursday, October 04, 2007 7:54:24 AM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

Google AdSense


Comments are closed.
All content © 2008, Daniel Wischnewski
On this page
Archives
Promoted Links
Blogroll OPML
My current Flickr Images
www.flickr.com
Dies ist ein Flickr Modul mit �ffentlichen Fotos und Videos von dwischnewski. Ihr eigenes Modul k�nnen Sie hier erstellen.
Recommendations
Sitemap
Special Pages
Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design by Jelle Druyts