free geoip CS Tidbits #22: Tame That Tag Cloud - Jayson's Blog

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 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!

Filed under:


# Community Server Daily News said:

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

Friday, 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

Monday, 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

Monday, March 12, 2007 9:26 AM

Leave a Comment