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

Creating Blog Breadcrumbs in Community Server

The Chameleon theming engine in Community Server 2007 makes creating blog breadcrumbs way too easy.  Below is a blog breadcrumb and the HTML code used to create it.  The circled HTML has to do with creating a tag breadcrumb link, which we'll look at next.  Please ignore it for now as we create a breadcrumb consisting of the site, the current blog's group, the blog and the post.

 

 

 

"Way too easy" would not, however, accurately reflect the process used to modify our breadcrumb to include the current tag.  We may want to display the tag when we're linking to a post from its tag post list and want to provide a link back to all posts for that tag.



Looking at the circled HTML above, we're using a ConditionalContent control with an asp:Hyperlink.  The ReturnTagUrl() looks like so.


 

It would be nice to use a CSControl:SiteUrl here instead of the ReturnTagUrl() hack, but while bound properties can be used to display the link's Text, they cannot be used as SiteUrl parameters.  Desperate urls call for desperate measures.

 

<CSControl:SiteUrl UrlName="weblogposttags" runat="server"
    Parameter1='<%# CSContext.Current.ApplicationKey %>'
    Parameter2='<%# CSContext.Current.QueryString["Tags"].ToString() %>'
    Text='<%# CSContext.Current.QueryString["Tags"].ToString() %>' />

 

And the "Tags" QueryString object?  Where does that come from?  It's a team effort between a custom WeblogPostData control, a DBVT custom Url class, and a new SiteUrls.config url entry.

The WeblogPostData control on the TagsList page containing the links to the individual posts requests a "PostWithTags" url.

 

 

The WeblogPostData control's GetHyperLink() method takes the snap

 

 

who hands-off to the custom Urls class



who laterals to the new "weblogpostNameTags" SiteUrls.config url entry

 


who crosses the hyperlink goal line and does some shakin' of his bootay!

Comments (0) | Post RSS RSS comment feed

Posted on 9/15/2007 8:20:11 PM by Dave Burke
Categories: .NET | Community Server

Related posts

Comments are closed

Copyright © 2008 Dave Burke Consulting  |  All Rights reserved.