In Valid Logic

Endlessly expanding technology

Configuring Single Blog/Gallery in Community Server v2.0beta3

As I had eluded to before, configuring a site to use a single blog or gallery in Community Server v2.0 beta3 and beyond will be incredibly easy.

In the past, this type of configuration has been achieved by manipulating the URL rewriting within Community Server to tell it which blog/gallery to use without it being in the URL.  In v1.0, it was a somewhat complicated process.  Then in v1.1, I came up with the idea of using a small application to generate the needed SiteUrls.config file.  For the most part, this worked, however things would get incredibly more complicated as the number of varying configuration mounted.  Most especially, when people wanted to have their blog in the root, and then other parts of the application underneath it.  It would get complicated where Community Server would mistake a request for the Photo Galleries as one for the blogs because of how the URL rewriting worked and was manipulated.

In talked with Scott Watermasysk, we came up with the idea of having some sort of URL mapping that would be done before the rewriting happened.  This would allow a request for /blog/ to be translated behind the scenes to /blogs/kensblog/ before the URL rewriting occurred, and completely unbeknownst to the user.  An implementation of this idea is included in Community Server v2.0 beta3, however it is quite the optimal way to handle a blog/gallery in the root, and I think it could be made even simplier.  It directly tied the folder (ie, /blog/ or /rants/) to the Application Key that would be required on the blog (ie, blog, or rants, respectively).

I’d come up with a slightly extended version, which I called Extended Mappings.  EMs basically allowed you to handle the remapping directly by the URL rather than by basing it on the folder name = application key.

Ok, so now to get to the point, you want to know exactly how easy will a single blog/gallery be with my Extended Mappings?  All it takes to install and configure it is these 3 easy steps:

1) Drop the DLL in the bin directory of Community Server

2) Change a provider entry in the and add a new provider entry (matter of cut and pasting).

3) Add the following section to the SiteUrls.config and set to your liking:

<font color=#0000ff size=2> <blockquote dir=ltr style=”MARGIN-RIGHT: 0px”>

<<font color=#800000 size=2>extendedMappings<font color=#0000ff size=2>>
<font color=#0000ff size=2>     <<font color=#800000 size=2>add<font color=#ff00ff size=2> <font color=#ff0000 size=2>path<font color=#0000ff size=2>="/blog"<font color=#ff00ff size=2> <font color=#ff0000 size=2>newPath<font color=#0000ff size=2>="/blogs/blog"<font color=#ff00ff size=2> <font color=#0000ff size=2>/>
<font color=#0000ff size=2>     <<font color=#800000 size=2>add<font color=#ff00ff size=2> <font color=#ff0000 size=2>path<font color=#0000ff size=2>="/photos"<font color=#ff00ff size=2> <font color=#ff0000 size=2>newPath<font color=#0000ff size=2>="/photos/photos"<font color=#ff00ff size=2> <font color=#0000ff size=2>/>
<font color=#0000ff size=2></<font color=#800000 size=2>extendedMappings<font color=#0000ff size=2>>

That is it!  The “path” property is the path you want it to work at, and the “newPath” is the path Community Server expects it at.  IE, all blogs default to /blogs/{appkey}/.  So if you want a blog with the application key of “kensrants” to work at “/rants/”.  You’d do:

<blockquote dir=ltr style="MARGIN-RIGHT: 0px">

<font size=2><font color=#0000ff><<font color=#800000>add<font color=#ff00ff> <font color=#ff0000>path<font color=#0000ff>="/rants"<font color=#ff00ff> <font color=#ff0000>newPath<font color=#0000ff>="/blogs/kensrants"<font color=#ff00ff> <font color=#0000ff>/>

That is all!  And the best part, if you want your blog at the root, all you do is change the path to “/”.  That is it!  Additionally, there is no need to worry about Community Server to mistake a request for you gallery as one for your blog, because using the extended mappings, it will ensure that an exact match is found before allowing the rewritten URL to be accepted.  So if it match in the blog’s mapping is not found, it will continue on to the galleries and so on.

I will be releasing this module once Beta3 hits the streets, so watch for it soon.


Monday, January 09, 2006

blog comments powered by Disqus