A Cloud of Categories

This is a real-world example of how tagcloud.php can be used in conjunction with a database query. The same examples are provided as for tagcloud.php, but the data is live from a query of the Smiffy's Place database. The query selects the number of posts that are associated with each category (they exist in a many-to-many relationship), the category title and URI. This is then processed and formatted in the same way as the dummy (fruit) data.

Example 1 - Ordered List, No Styling

The above example gives a "Top Ten" style of output, which the author regards as being the most accessible.

The following example then adds visual weight by changing font sizes.

Example 2 - Ordered List, Styling

Example 3 - Ordered List, Removed List Format

Below, we remove the usual visual formatting of our list, producing something more like a Tag Cloud, but still in descending order of sequence.

Example 4 - Tag Cloud

We now present the tags in alphabetical order, with weight being assigned purely visually, by font size. This is the least accessible result, although the weight/sequence has been added to the link title.

Comments on this may be left against the relevant blog post.