HTML5-compliant tag cloud. Functions as non-Flash replacements for both 'tag_cloud' and 'tag_cloud_page' modules, with some extra features added.
This is NOT a replacement for the 'tags' module, only for both 'tag_cloud' and 'tag_cloud_page' modules. The 'tags' module is still required.
This module uses a modified version of TagCanvas, a non-flash, HTML5-compliant jQuery plugin. It also uses excanvas to maintain compatibility with pre-9.0 Internet Explorer. This means that it's 100% compliant with all modern browsers, including all iOS devices and Internet Explorer 8.
TagCanvas was based on the concept of the original module WP-Cumulus. The core of WP-Cumulus, tagcloud.swf, was used for the original 'tag_cloud' and 'tag_cloud_page' Gallery modules.
Similar to older modules:
Tested and functioning well on Gallery v3.0.4. Works with both old and new versions of jQuery (e.g. GreyDragon theme v4).
Note that this module is intentionally NOT named 'tag_cloud' to avoid confusion with the previous module. However, the 'HTML5' text is only shown on admin screens; the regular interface is not cluttered with it.
The settings are in three groups. The first is general, which are those you're most likely to change. The next two groups are directly passed as options to TagCanvas - one set for the sidebar block, and one for the whole cloud page. For more on these options, see the TagCanvas homepage here.
You can embed the tag cloud in other parts of your website outside gallery. This is done by calling a URL, then dumping its results into your page. For this to work, your main gallery is viewable to everyone (otherwise, a login screen will appear instead of the tag cloud).
It's strongly recommended to use PHP's file_get_contents and not an HTML object to render the tag cloud. The result is much more SEO-friendly, as it provides the links for the tags themselves directly in the source instead of the odd, non-SEO-friendly tag cloud URL. Also, it means that the tag cloud will inherit the text formatting from the rest of the page when applicable.
<div id="example-name" style="width: 500px; height: 500px"> <?= file_get_contents("http://example.com/gallery3/tag_cloud/embed/wholecloud/maxtags/100/outlineColour/00FF00/textHeight/18"); ?> </div>
The above example will:
More specifically, the URL should be formed as follows:
tag_cloud/embed/optionsbase/option1/value1/option2/value2/.../optionN/valueN optionsbase = "sidebar" or "wholecloud" (takes settings from this config) optionX = option name (either "maxtags" or any of the TagCanvas parameters - no name verification performed!) valueX = value of option (no value verification performed here!)
Here's how the tag cloud is built: 1. Load "maxtags" and "options" variables for optionbase (as defined in admin menu or admin/advanced variables). Note that width and height are ignored, and the add tag form, wholecloud link, and inline tags are not shown. 2. Use option/value pairs to override and/or append those loaded above. 3. Build tag cloud, using 100% of the size from its parent. Correspondingly, the optionsbase is required, but the options and values are not.
Some other notes:
As mentioned above, I've modified TagCanvas. In particular, I built an all-new physics-based motion model, added some more parameters, and did some bug fixes which are not a part of the original package as of this writing (2012/06/08).
The JS file included in the module is therefore called jquery.tagcanvas.mod.min.js, and has been minified and is therefore largely incomprehensible. If you're curious, I've also included the full-sized JS library for reference (although it is not used during runtime).
Added embed feature Changed how excanvas is called with IE8 and earlier Fixed bug with localization of parameters on admin settings screen
Fixed TagCanvas bug that miscalculated mouse position the html object had non-zero margins in some browsers.
Added physics-based motion model to TagCanvas Added even more parameters to admin screen Reformatted admin screen completely Changed upgrade logic to preserve old settings
Added option to change sidebar cloud height
Added option to display or hide the 'Add tag to album' form Changed formatting of whole cloud page slightly Added CSS to admin screen for better formatting Added modified TagCanvas plugin with 'initialDecel' and 'deadZone' parameters Added option for dead zone Added option for initial speed and deceleration
Fixed bug that allowed scrolling to screw up the display (by setting wheelZoom option in TagCanvas to false)