Do You Like Tag Clouds?
- By Mitchell Harper
- Published 07/23/2007
- StoreSuite Features , User Interface , StoreSuite Updates
-
Rating:




I've just spent the last few hours building a tag cloud panel for
StoreSuite. It appears when you're shopping by brand, so it's
contextually relevant - if you choose to view products grouped by brand,
you'd want to see a tag cloud for the other brands, right?
The opinion around the office is split - in fact it seems that I'm the only one who likes tag clouds. All of the guys think they're just a "web 2.0 fad" but I disagree. I find them useful as a visual aid when browsing a site that uses them.
If you don't know what a tag cloud is, here's the brands tag cloud that I've just integrated into StoreSuite:

So in my demo of StoreSuite that I have installed on our development server, I have about 20 brands. Disney contains the most products, so it appears larger and bolder than the other brands. Apple, HSBC and Max's contain a medium amount of products, and Fox, Atari, HP, etc contain just a few products.
Do you use tag clouds when you're browsing around the web? How about when you shop? I bet not, because I couldn't find an online retailer that uses tag clouds. Of course StoreSuite will include the option to turn off tag clouds, in which case the brands tag cloud shown above would simply be replaced with a standard list of brands for browsing.
When I decided to build a tag cloud I had no idea where to start, but this ColdFusion article gave me all of the logic I needed. The process basically works like this:
The opinion around the office is split - in fact it seems that I'm the only one who likes tag clouds. All of the guys think they're just a "web 2.0 fad" but I disagree. I find them useful as a visual aid when browsing a site that uses them.
If you don't know what a tag cloud is, here's the brands tag cloud that I've just integrated into StoreSuite:

So in my demo of StoreSuite that I have installed on our development server, I have about 20 brands. Disney contains the most products, so it appears larger and bolder than the other brands. Apple, HSBC and Max's contain a medium amount of products, and Fox, Atari, HP, etc contain just a few products.
Do you use tag clouds when you're browsing around the web? How about when you shop? I bet not, because I couldn't find an online retailer that uses tag clouds. Of course StoreSuite will include the option to turn off tag clouds, in which case the brands tag cloud shown above would simply be replaced with a standard list of brands for browsing.
When I decided to build a tag cloud I had no idea where to start, but this ColdFusion article gave me all of the logic I needed. The process basically works like this:
- Get a list of brands from the database as well as how many products each brand has.
- Workout the minimum and maximum number of products per brand
- Workout the distribution of products per brand
- Give each brand a CSS class based on that distribution: smaller, small, medium, large or largest
$output = "";
$brands = array();
$min = 0;
$max = 0;
$diff = 0;
$distribution = 0;
// Get the number of brands
$query = "select count(brandid) as num from [|PREFIX|]brands";
$result = $GLOBALS["STS_CLASS_DB"]->Query($query);
$row = $GLOBALS["STS_CLASS_DB"]->Fetch($result);
$num_brands = $row["num"];
if($num_brands > 0 && $GLOBALS["TagCloudsEnabled"]) {
// Hide the alternate side brand panel
$GLOBALS["HideSideShopByBrandFullPanel"] = "none";
// Get the 5 most popular brands
$query = "select b.brandid, b.brandname, (select count(productid) from [|PREFIX|]products p where p.prodbrandid=b.brandid and p.prodvisible='1') as num from [|PREFIX|]brands b order by b.brandname asc";
$result = $GLOBALS["STS_CLASS_DB"]->Query($query);
while($row = $GLOBALS["STS_CLASS_DB"]->Fetch($result)) {
$brands[] = $row;
}
// Find the minimum and maximum products per brand
foreach($brands as $k=>$v) {
// Is it the new minimum?
if($min == 0)
$min = $brands[$k]["num"];
if($brands[$k]["num"] > 0 && $brands[$k]["num"] < $min)
$min = $brands[$k]["num"];
// Is it the new maximum?
if($brands[$k]["num"] > $max)
$max = $brands[$k]["num"];
}
// Is there only one brand?
if($min == $max)
$min = 0;
// Workout the differences and distribution
$diff = $max - $min;
$distribution = (int)($diff / 3);
foreach($brands as $k=>$v) {
// Workout the tag size and output the brandname
$num = $brands[$k]["num"];
$class = "";
if($num == $min)
$class = "smallest";
else if($num == $max)
$class = "largest";
else if($num > ($min + ($distribution*2)))
$class = "large";
else if($num > ($min + $distribution))
$class = "medium";
else
$class = "small";
// Create a snippet for the template system
$GLOBALS["BrandLink"] = BrandLink($brands[$k]["brandname"]);
$GLOBALS["BrandName"] = $brands[$k]["brandname"];
$GLOBALS["TagClass"] = $class;
$output .= $GLOBALS["STS_CLASS_TEMPLATE"]->GetSnippet("BrandCloudItem");
}
$GLOBALS["SNIPPETS"]["SideBrandTagCloud"] = $output;
}
else {
// Hide the panel
$GLOBALS["HideBrandTagCloudPanel"] = "none";
}
Register for Your Beta Invite
Be the first to test drive StoreSuite. Fill out the form below to receive an exclusive beta invite when StoreSuite's ready to test.
Spread The Word
Comments
Comment #1 (Posted by Richard Koeleman)
Rating:








The tag cloud looks great, especially if this can be shown for brands, products, and perhaps even for most popular product options.
Just a small thing I seem to be missing/not understanding, The amount of sales that this brand generated, the number of hits in terms of viewing, thus creating the tag cloud by popularity next to creation by hard database data.
I guess where I am going is trying to find ways to automatically display dynamic data based on statistics that will automatically make certain popular products perform even better without the interference of the human store owner... smart shopping software :)
[From Mitch: Hi Richard. The tag cloud is generated automatically based on how many products are linked to each specific brand: the more products under a brand, the larger it appears in the tag cloud. The code is easy to customize so you could factor any other variables in if you want.]
Just a small thing I seem to be missing/not understanding, The amount of sales that this brand generated, the number of hits in terms of viewing, thus creating the tag cloud by popularity next to creation by hard database data.
I guess where I am going is trying to find ways to automatically display dynamic data based on statistics that will automatically make certain popular products perform even better without the interference of the human store owner... smart shopping software :)
[From Mitch: Hi Richard. The tag cloud is generated automatically based on how many products are linked to each specific brand: the more products under a brand, the larger it appears in the tag cloud. The code is easy to customize so you could factor any other variables in if you want.]
Comment #2 (Posted by Minty Blog)
Rating:








The Tag Cloud feature will be great i think you should get almsot all web2.0 features in this Shopping cart and may be you can call it one of the first Web 2.0 carts just an idea ;)
Comment #3 (Posted by Sean)
Rating:








I think it will be great as long as you can disable and enable it if you dont want to use it.
Comment #4 (Posted by Jordan)
Rating:








I think having the option for a tag cloud is very nice. I agree with the above comment though... tag clouds would typically be more associated with a "Most Popular" list instead of a Brand list, but I like the thinking out of the box approach.
If you are looking for nice web 2.0 enhancements for a shopping cart, take a look at Product Cart. I know you have a philosophy of not having to reinvent the wheel, and I think they have some nice features for a shopping cart. http://www.earlyimpact.com/
I have absolutely no affiliation with them. In fact I am eagerly anticipating Store Suite.
If you are looking for nice web 2.0 enhancements for a shopping cart, take a look at Product Cart. I know you have a philosophy of not having to reinvent the wheel, and I think they have some nice features for a shopping cart. http://www.earlyimpact.com/
I have absolutely no affiliation with them. In fact I am eagerly anticipating Store Suite.
Comment #5 (Posted by John)
Rating:








You can only comment once per article??
I'll follow up here then...
Please try to skip the /categories/ and /products/ directories for seo... it is possible!
Looks much nicer to skip a level for use with
mydomain.com/electronics/computers/ rather than:
mydomain.com/categories/electronics/computers/
Thanks.
I'll follow up here then...
Please try to skip the /categories/ and /products/ directories for seo... it is possible!
Looks much nicer to skip a level for use with
mydomain.com/electronics/computers/ rather than:
mydomain.com/categories/electronics/computers/
Thanks.
Comment #6 (Posted by Cindy Scinto)
Rating:








Yes to Tag Clouds!
