Quick and Dirty ad rotation in Community Server 2007
I needed to setup ad rotation for a client in Community Server 2007. The goal was to rotate through a pool of ads for internal events and content. There was no need for tracking impressions and click through rates. So something like adMentor seemed like over kill.
After consulting Google I found an old post on CommunityServer.org. It showed how to use the ASP.NET ad rotator control in CS 2.1. So information here isn't original. But, it adapted to cs2007.
My client is using a modified version of the Lean and Green theme. So will use that as my example.
Open the Themes\leanandgreen\Common\ad-top.ascx.
below <%-- Place ad mark-up here --%> enter. Delete any other text that may be below this tag.
<div align="center">
<asp:AdRotator id="adRotator"
runat="server" AdvertisementFile="ads.xml" Target="_top" />
</div>
This declares the ASP.NET AdRotator control, and obviously centers it.
repeat these steps for ad-bottom.ascx
Create a ads.xml file in the Themes\leanandgreen\Common\ directory. The format of this file should be. (for more in depth explanation see MSDN)
<Advertisements>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/conferencebanner.jpg</ImageUrl>
<NavigateUrl>http://www.albinism.org/noahevents.html?utm_source=AOC&utm_medium=banner&utm_content=conferencebanner&utm_campaign=Conference2008</NavigateUrl>
<AlternateText>Ad: NOAH National Conference Information</AlternateText>
<Impressions>50</Impressions>
<Keyword>Conference</Keyword>
</Ad>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/conferencebanner2.jpg</ImageUrl>
<NavigateUrl>http://www.albinism.org/noahevents.html?utm_source=AOC&utm_medium=banner&utm_content=conferencebanner2&utm_campaign=Conference2008</NavigateUrl>
<AlternateText>Ad: NOAH National Conference Information</AlternateText>
<Impressions>50</Impressions>
<Keyword>Conference</Keyword>
</Ad>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/newcity.jpg</ImageUrl>
<NavigateUrl>http://www.albinism.org/noahevents.html?utm_source=AOC&utm_medium=banner&utm_content=newcity&utm_campaign=Conference2008</NavigateUrl>
<AlternateText>Ad: NOAH National Conference Information</AlternateText>
<Impressions>50</Impressions>
<Keyword>Conference</Keyword>
</Ad>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/giveback.jpg</ImageUrl>
<NavigateUrl>http://www.albinism.org/contribute.html?utm_source=AOC&utm_medium=banner&utm_content=giveback&utm_campaign=Funding</NavigateUrl>
<AlternateText>Ad: Support NOAH Funding</AlternateText>
<Impressions>50</Impressions>
<Keyword>Funding</Keyword>
</Ad>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/purplebowlathonbanner.jpg</ImageUrl>
<NavigateUrl>http://www.events.org/noah08/cpage.aspx?e=12334</NavigateUrl>
<AlternateText>Ad: NOAH Bowl-A-Thon</AlternateText>
<Impressions>50</Impressions>
<Keyword>BowlAThon</Keyword>
</Ad>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/thingathon.jpg</ImageUrl>
<NavigateUrl>http://www.events.org/noah08/cpage.aspx?e=12334</NavigateUrl>
<AlternateText>Ad: NOAH Bowl-A-Thon</AlternateText>
<Impressions>50</Impressions>
<Keyword>BowlAThon</Keyword>
</Ad>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/puzzle.jpg</ImageUrl>
<NavigateUrl>http://www.events.org/noah08/cpage.aspx?e=12334</NavigateUrl>
<AlternateText>Ad: NOAH Bowl-A-Thon</AlternateText>
<Impressions>50</Impressions>
<Keyword>BowlAThon</Keyword>
</Ad>
<Ad>
<ImageUrl>http://www.albinism.org/bannerads/whatthingathon.jpg</ImageUrl>
<NavigateUrl>http://www.events.org/noah08/cpage.aspx?e=12334</NavigateUrl>
<AlternateText>Ad: NOAH Bowl-A-Thon</AlternateText>
<Impressions>50</Impressions>
<Keyword>BowlAThon</Keyword>
</Ad>
</Advertisements>
Finally log into your control panel. Then choose Administration / System Tools / Manage Ads.
Check Enable ads, check enable inline ad control, finally uncheck SystemAdminstrator if you want you admins to see ads as well.
Good luck, let me know if you found this helpful, or have any questions.