utilitees

- Addons for ExpressionEngine 1.6.x

Category Cloud Documentation

Download Download

Installation:

Unzip the archive and copy the file pi.cat_cloud.php into the plugins-directory inside your Expression Engine system-directory.
If you want to use the flash cloud see also Installing WP-Cumulus.

Back to top

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 weblog=“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:

weblog="blog" 

This parameter is mandatory.
The weblog 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:weblog:categories}.

category_group="2" 

This parameter is optional.
If your weblog 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.

Back to top

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.

Back to top

 

Questions / bug reports

For general comments, brickbats & bouquets please use the form over here.
Name:

Email:

URL:


Remember my personal information
Notify me of follow-up comments?


Page 2 of 3 pages  <  1 2 3 >

User Talk

puck:
2009-05-19 04:15

There seem to be some typos on lines 90-91 that prevent the transparency parameter from working:

      $trans = ( ! $TMPL->fetch_param(‘trans’)) ? false : (boolean) $TMPL->fetch_param(‘trans’);
          $trans =

Should the value *false* be in quotes and the extraneous “$trans =” deleted? I hacked this on my version and it seems to work fine to reactivate transparency.

Thanks so much for this plugin!



Oliver:
2009-05-07 23:20

You must download this plugin first and follow the Installation instructions lined out on this very page.



gesf:
2009-05-07 21:27

Hello.

I can get this to work. Whatever i do i always get:
{exp:cat_cloud} Please correct the syntax in your template.

This is right ‘cause i have no plugin (pi.), or… is this “cat_cloud” only available for licensed version of EE !?

Thanks you
~ gesf



Oliver:
2009-04-28 06:37

Make sure you are actually using normal quotation marks in your tags.



Lawrence:
2009-04-28 03:09

OK, I am admittedly rather dense in regards to programming.  I have copied and pasted the code from here, and placed the wp-cumulus folder in every folder named “themes”.


I have tried naming my template and weblog directly and using the {my_weblog} and {my_template_group} tags. Still no matter what I try when I generate my page I get a {exp:cat_cloud} weblog=”” missing at the top of my page and nothing but dead space where I actually placed the tag?


Any ideas? 

Thanks!



Gambit:
2009-04-10 23:00

@Oliver,

Thanks for the information, much appreciated and sorry for the ignorance of php vulnerabilities etc.

Cheers,



Oliver:
2009-04-10 20:51

bo-oz made the general statement that plugins that don’t take user input are always secure.

I argued “generally speaking” (generally as in not related to this plugin) that *any* php script can potentially open a security hole through bad coding practice.

There is no known security risk involved with the Category Cloud plugin. Neither with the flash cloud nor with the rest.



Gambit:
2009-04-10 18:21

I was reading over this post and the information is important to me as well, as I wouldn’t want to expose a client to unnecessary security vulnerabilities by adding a small display feature.

There was mention of an attack-vector in one of your posts. I am guessing this may have to do with the flash method of displaying the categories.
- Is this true?
- Would the plugin be any more secure without the information to include the Flash plugin?
- If so, could you tell me what portion of the plugin code to remove so that it doesn’t have the ability to use the Flash plugin, since this feature isn’t of interest to me anyway.

I’d really appreciate it.



Oliver:
2009-04-10 10:47

@bo-oz: That “trans”-behaviour has been fixed in the latest version.

I think a plugin that requires no (end)user-input cannot be a security risk, since it is not manipulable by them.

Generally speaking, the plugin file itself *could* offer some attack-vector as well, even if the plugin-functionality as such has nothing do do with user input.



bo-oz:
2009-04-10 09:34

@Oliver.. have you looked into my post of “2009-03-26 18:24”?

@Deeziner, I think a plugin that requires no (end)user-input cannot be a security risk, since it is not manipulable by them. This plugin for instance ‘only’ generates HTML output.