tag_cloud
— Create a tag cloud made of divs that follow the hTagcloud microformat
Summary
- tag_cloud($recordOrTags = null, $link = null, $maxClasses = 9, $tagNumber = false, $tagNumberOrder = null)
Create a tag cloud made of divs that follow the hTagcloud microformat
- Parameters:
$recordOrTags (
Omeka_Record_AbstractRecord|array
) – The record to retrieve tags from, or the actual array of tags$link (
string|null
) – The URI to use in the link for each tag. If none given, tags in the cloud will not be given links.$maxClasses (
int
) –$tagNumber (
bool
) –$tagNumberOrder (
string
) –
- Returns:
string HTML for the tag cloud
Usage
Examples
Add a tag cloud to a page. Use the $link
parameter to set the base url for the tags.
<?php echo tag_cloud($tags, 'exhibits/browse'); ?>
Use the $maxClasses
parameter to set the max count used to calculate tag size. Range supported by themes is 1-9.
<?php echo tag_cloud($tags, 'exhibits/browse', 5); ?>
Use the $tagNumber
and $tagNumberOrder
parameters to display the count for each tag. The possible values for $tagNumberOrder
are ‘before’ and ‘after’.
<?php echo tag_cloud($tags, 'exhibits/browse', 5, true, 'before'); ?>