Documentation: Category Cloud

 

Installation:

Unzip the archive and copy the folder cat_cloud into the /expressionengine/third_party/-directory inside your system-directory.
If you want to use the flash cloud see also Installing WP-Cumulus.

Displaying a category-cloud

There is only one tag to rule them all. It’s a single ExpressionEngine tag with no closing element.

{exp:cat_cloud} 

Example:

{exp:cat_cloud channel="directory" template="games/by" width="300" height="250" format="flash" category_group="2" font_min="8" font_max="24" bgcolor="ffffff" tcolor="000000" tcolor2="cccccc" hicolor="00ff00" bgcolor="ffffff" limit="20" distr="true"

Parameters:

channel="blog" 

This parameter is mandatory.
The channel from which you want to generate the cloud.

template="site/index" 

This parameter is mandatory.
Specify the templategroup/template which is used to display your entries by category.
This would usually be the same template you’d use in conjunction with {exp:channel:categories}.

category_group="2" 

This parameter is optional.
If your channel uses more than one category group you may limit which groups are to be included. Category groups are specified by ID number (the ID number of each category group is displayed in the Control Panel).
You can stack category groups:
category_group=“1|2|4”
Or use “not” to exclude categories
category_group=“not 2”

format="html"
format="flash" 

This parameter is optional. If not specified, the default is “html”.
In order to use the flash-cloud you need to install the WP-Cumulus Plugin.

limit="X" 

Optional. This limits the cloud to the X most popular categories.

font_min="" 

Optional. This is the minimum font-size (in pt) an unpopular tag can reach.
Defaults to 10.

font_max="" 

Optional. This is the maximum font-size (in pt) a popular category can reach.
Defaults to 25.

orderby="pop" 

Optional. By default the Category-cloud is ordered alphabetically. You can order it by popularity if you set this parameter.
This parameter only applies to format=“html”.

The following parameters only apply to format=“flash”. They control several aspects of the rendered flash-movie.

width="400" 

Optional. Defaults to 400.
The movie will scale itself to fit inside whatever dimensions you decide to give it. If you make it really small, chances are people will not be able to read less-used tags that are further away. Anything up from 300 will work fine in most cases.

height="300" 

Optional. Defaults to 300.
Ideally, the height should be something like 3/4 of the width. This will make the rotating cloud fit nicely, while the extra width allows for the tags to be displayed without cropping. Western text is horizontal by nature, which is why the ideal aspect is slightly landscape even though the cloud is circular.

tcolor="#000000"
tcolor2="#cccccc" 

Optional. Color of the tags. tcolor default to #ffffff (white). tcolor2 defaults to tcolor.
Type the HTML color value you’d like to use for the tags, with or without the ‘#’. Black (000000) will obviously work well with light backgrounds, white (ffffff) is recommended for use on dark backgrounds. Optionally, you can use the tcolor2-parameter to specify a different color. When two colors are available, each tag’s color will be from a gradient between the two. This allows you to create a multi-colored tag cloud.

hicolor="#00ff00" 

Optional . Mouseover highlight color. Defaults to #ff0000 (red).

bgcolor="#ff0000" 

Optional. The background-color of the movie. Defaults to #000000 (black).
This option has no effect when you set the trans-parameter to ‘true’.

distr="" 

Optional. Defaults to ‘false’.
If you set this to ‘true’ the movie will attempt to distribute the tags evenly over the surface of the sphere.

tspeed="" 

Optional. Defaults to 100.
This allows you to change the speed of the sphere. Options between 25 and 500 work best.

trans="true" 

Optional. Defaults to ‘false’.
Set to ‘true’ or ‘false’ to turn on/off background transparency. Enabling this might cause issues with some (mostly older) browsers. Under Linux, transparency doesn’t work in at all due to a known limitation in the Flash player.

Installing WP-Cumulus

For those who want a more fancy tagcloud I added support for WP-Cumulus.

To use it you need to download the Wordpress-Plugin here. Unpack the archive and upload the folder wp-cumulus to your ExpressionEngine themes-folder. You only need the files swfobject.js and tagcloud.swf. You can and probably should delete the other files.

 

Changelog:

  • Version 2.0
    • Initial release for ExpressionEngine 2