Dave Burke : Freelance .NET Web Developer specializing in Online Communities

CS20 : Adding a new site area

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" iTunes

The /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:

Comments (1) | Post RSS RSS comment feed

Posted on 3/12/2006 9:10:00 PM by Dave Burke
Categories: Community Server
Tags:

Related posts

Comments (1) -

3/15/2006 3:27:03 PM Permalink

Hmm...things look a little different around here.  From Firefox: Ctrl-Shift U --

The site looks awesome!  I do want to know how you got those spiffy RSS images in your category list...my attempt on my site brought it crashing to its knees.

jayson knight |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke