| function smarty_function_tag_cloud( | | $params, | | & | $smarty | ) |
|
Prints a ‘tag cloud’ generated from the passed parameters.
Arguments
| $params | An array of variables. |
| &$smarty | TBD |
Params
| tags (associative array) | An array of tags and the totals for each tag. (see “Tag Array Example” below) |
| base_url (string) | The base portion of the URL to which the tag will be appended. |
| min_font_size (optional integer) | The font size for the smallest tag in the cloud. |
| max_font_size (optional integer) | The font size for the largest tag in the cloud. |
| class | optional - string - The CSS class to assign to the outer tag cloud HTML element. Defaults to ‘tag_cloud’. |
| levels (optional) | An integer representing the number of ranks to divide into tags. Defaults to 6. |
| item_type (optional) | string - Tells the view what to output as the word for what the tags represent (e.g.: items, books, shoes, etc). Defaults to ‘item(s)’. |
| limit optional integer | An integer representing the maximum number of tags to include in the cloud. Defaults to 20. |
Returns
A string containing an HTML ordered list (<ol>) full of tags.
Tag Array Example
$tags = Array();
$tags['horse'] = 22;
$tags['cow'] = 12;
$tags['chicken'] = 30;
$tags['goat'] = 23;
Execution Example
<!-- as used in a Smarty view template -->
{tag_cloud tags=$my_tags base_url='/search.php?q='}