free geoip CS Tidbits #22: Tame That Tag Cloud - protected virtual void jaysonBlog
in

jaysonKnight.com

Welcome to my corner of the internet

protected virtual void jaysonBlog

A conduit to the voices in my head

CS Tidbits #22: Tame That Tag Cloud

Rob Howard recently posted about an interesting topic: Should tags in CS be moderated.  My opinion on that is outside the realm of today's tidbit (though I'll give you a hint...I think options are always a good thing), but there is a sort of band-aid solution that can be applied in the interim if site admins notice their tag clouds spiraling rapidly out of control which can happen in one of 2 scenarios: Users are abusing tags, or you have a blog that hosts mirrored content from a large number of sites that all have members posting their content to various tags.  Before long you end up with a very large tag cloud with numerous (random) tags that only have 1 or 2 posts in them, which leads to clutter and messiness.

There are actually 2 ways around this:

  1. Define default tags for your aggregate...only those tags will be displayed in the tag cloud, but the side effect of this is that only posts grouped in the default tags will be displayed on the aggregate.  This actually tripped up many of the posters over on weblogs.asp.net when it was upgraded to CS 2.1, plus it's tedious to set up.  A more ideal solution would be to...
  2. Define the maximum number of tags that can be displayed in the tag cloud for a specific tag cloud control or
  3. Define the minimum number of posts a tag must contain to be displayed in the tag cloud.

I personally think #3 is a more ideal solution, but I'll cover both as it's quite easy to implement.  Any control that declares a <Blog:TagCloud> control (or any type of tagcloud, i.e.<CS:TagCloud>, <Galleries:TagCloud>, etc) expose both a MaximumNumberOfTags property (applies to #2, the default value is 100) and a MinimumPostsPerTag property (applies to #3, the default value is 1).  Things should be pretty self explanatory at this point, simply add one (or both) of the above properties to your tag cloud control declaration in your skin file and set the value that you want.  Of course these numbers should be set based on just how wild you want your tag cloud to get.  For sites with lots of members/posters, I would recommend going with a MinimumPostsPerTag value of 5; that should weed out any stray tags that aren't pertinent to the main focus of the site.  It's that simple!

Share this post: Submit CS+Tidbits+%2322%3a+Tame+That+Tag+Cloud to Technorati | Submit CS+Tidbits+%2322%3a+Tame+That+Tag+Cloud to del.icio.us | Submit CS+Tidbits+%2322%3a+Tame+That+Tag+Cloud to digg.com | Submit CS+Tidbits+%2322%3a+Tame+That+Tag+Cloud to reddit.com | Submit CS+Tidbits+%2322%3a+Tame+That+Tag+Cloud to DotNetKicks | Add CS+Tidbits+%2322%3a+Tame+That+Tag+Cloud to Live Bookmarks
Only published comments... Sep 08 2006, 12:57 AM by Jayson Knight
Filed under:

Comments

 

Community Server Daily News said:

news of the day a grab bag for what's happening in Community Server Another Community Server-powered

September 8, 2006 1:51 PM
 

Community Server Bits said:

How to limit the number of tags that appear on a tag cloud. Added to General Discussion forum FAQ. Thanks

March 12, 2007 6:12 AM
 

Community Server Bits said:

Jayson Knight returns big with CS Tidbit #22 on Taming that Tag Cloud. Jayson looks at three approaches

March 12, 2007 9:26 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About Jayson Knight

Jayson Knight was clueless to the computer programming world until he took a C++ class in college. The rest is proverbial history. He has been building applications targeting the .Net framework for 7 years, focusing mainly on internet technologies and database driven web application development.

Most recently he left the world of Corporate IT to finish up his degree in Chemistry, with an eye on Medical School and an Anesthesiology residency program. Read this post for more information.

He is also a Community Server MVP: Community Server is the software that runs this site, plus many others on the web. For more information, check out http://csmvps.com.

When he finds time to pry himself away from his computer and university studies, he can be found on the mountain bike trails when it's warm, and on the ski slopes when it's cold.

Copyright © :: JaysonKnight.com
External Content © :: Respective Authors

Terms of Service/Privacy Policy