Functions/item tags as cloud

The item_tags_as_cloud will display the tags for an item as a tag cloud. The tag cloud uses the hTagCloud microformat syntax.

Usage

<?php item_tags_as_cloud(
    $order = 'alpha', 
    $tagsAreLinked = true, 
    $item=null, 
    $limit=null
);
?>

Arguments

  • order - The order in which tags are displayed. The default value is alphabetical. Available values include:
    • recent
    • most
    • least
    • alpha
  • tagsAreLinked - (boolean) Determines whether individual tags are linked to the items/browse page to show all items for that tag. Default is true.
  • item - The item object. Default is null. If null, the current item is used.
  • limit - The number limit of tags you want to display. Default is null. If null, all tags are returned.

Examples

Default Usage

The following example can be used in the items/show.php template in the default theme:

<?php echo item_tags_as_cloud(); ?>

This will generate the following HTML:

<div class="hTagcloud">
    <ul class="popularity">
        <li class="v-popular">
            <a href="http://example.com/items/lorem">Lorem</a>
        </li>
        <li class="vvv-popular">
            <a href="http://example.com/items/ipsum">Ipsum</a>
        </li>
        <li class="popular">
            <a href="http://example.com/items/dolor">Dolor</a>
        </li>
    </ul>
</div>