I’m using a blog to serve as a directory for one of my clients who asked me to replace the Tag Cloud behavior with primary and secondary categories. It’s always interesting to modify aspects of Community Server and having the capability to do so is another reason why Community Server is such a fantastic platform.
Below is what the Primary and Secondary tag arrangement looks like on my development site. It’s important to note that the “Directory Tags” below have all of the functionality of Community Server tags, their essential difference being how they appear on the directory blog.
I extended the PostCategory object to become a DirectoryCategory object, containing a boolean property named IsPrimaryCategory. This is managed in the Control page through new pages slightly modified from PostCategories.aspx and CategoryForm.aspx. We’re not replacing Community Server tags functionality across the site, only modifying it for our directory purposes, so we added a new sidebar menu for Directory Category management in our blog navbar.config.
In our custom library we want our own DirectoryCategory class to replace the default PostCategory class, our DirectoryCategories and DirectoryTags components to hand-off tasks to the Data Provider, and a custom DirectoryTagCloud control.
In the custom DirectoryTagCloud control we add a ShowPrimaryCategories property which we specify when creating the control.
<DBVT:DirectoryTagCloud ID=”Tagcloud1″ tagcssclasses=”DirectoryTag”
runat=”server” ignorefiltertags=”true” tagcloudcssclass=”DirectorySidebarTagCloud”
Replacing the cloud UI effect with a list format is easily achieved through using a single “tagcssclasses” property for all tags and modifying its CSS accordingly.