category::tagcloud::tagcloud (public)

 category::tagcloud::tagcloud -tree_id tree_id

Defined in packages/categories/tcl/tagcloud-procs.tcl

Generate a tag cloud for the categories in the given category tree.

Switches:
-tree_id
(required)
Options:
-tree_id
tree_id of the tree for which to generate the cloud.
Returns:
HTML fragment for the tag cloud.
Author:
Matthew Burke <matt-oacs@bluedino.net>

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_object_mapping category_object_mapping (test categories) category::tagcloud::tagcloud category::tagcloud::tagcloud test_category_object_mapping->category::tagcloud::tagcloud category::tagcloud::get_minmax_tagweights category::tagcloud::get_minmax_tagweights (private) category::tagcloud::tagcloud->category::tagcloud::get_minmax_tagweights category::tagcloud::get_tags category::tagcloud::get_tags (public) category::tagcloud::tagcloud->category::tagcloud::get_tags category::tagcloud::scale_weight category::tagcloud::scale_weight (private) category::tagcloud::tagcloud->category::tagcloud::scale_weight

Testcases:
category_object_mapping
Source code:
    set html_fragment "<div class=\"tagcloud\">\n"
    set tag_list [category::tagcloud::get_tags -tree_id $tree_id]

    # now build the frag
    set weights [category::tagcloud::get_minmax_tagweights -tag_list $tag_list]

    # and what if category package isn't mounted at /category?

    foreach tag $tag_list {
        append html_fragment "<a href=\"/categories/categories-browse?tree_ids=$tree_id&category_ids=[lindex $tag 0]\" style=\"font-size: [category::tagcloud::scale_weight -weight [lindex $tag 1] -extremes $weights]px;\" class=\"tag\">[lindex $tag 2]</a>\n"
    }
    append html_fragment "</div>"

    return $html_fragment
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: