I am in the process of adding my iTunes Library to CS 2.0 as it appears
on my CS 1.1 site here, but I wanted to do things differently this time around. I wanted to break out iTunes as its separate area (menubar below), as a separate CS Application of sorts (as far as the UI is concerned, anyway.) This approach automatically adds an "iTunes" menubar item to all site pages, conforms the style of the iTunes pages to the existing Theme, and gives us the freedom to add controls specifically for that page with very little effort.
In short, what I wanted was a new site area, use my existing theme with no extra work, and be able to add skinned sidebar skin controls that were different from those on my blog page. This approach does that.
First we add a link to SiteUrls.config and a resource to Resource.xml.
SiteUrls.config
link name="itunes" navigateUrl="/blog/itunes.aspx" resourceName="itunes" roles="Everyone" Resource.xml
resource name="itunes" iTunesThe /blog/itunes.aspx loads a CS view as any other CS page does. The view loads the LayoutTemplate.ascx which loads the MasterPage Template ASCX. The MasterPage Template is where you have the freedom to add new controls on the page, yet leverage the existing Weblog Theme. Here we can set the Template property at runtime from the view-iTunes.ascx. That's the secret sauce in this being very easy to do. Here's the
view-iTunes.ascx. Notice the Template="iTunesTemplate.ascx" property.
So we end up with what looks like a new application in CS 2.0 by adding a new resource with two lines of XML code, loading a custom layoutTemplate from a simple view and its own custom MasterPage. Then we add existing or new skinned controls that conform to the existing Theme and Masterpage layout for our site.
Technorati Tags: Community Server