Tags Template Tags
The following template tags are used to output tags information.
Most Used Tags
This template tag is used to output a list of the most used tags on your forum in a list format.
sf_most_used_tags($limit=10);
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $limit | How many tags to show in the list. | Integer | 10 |
User specified styles available for template tag output is:
| Styles | Affected Output |
|---|---|
| li.sftaglist | Styles the <li> elements. |
An example usage of the template tag is:
<?php sf_most_used_tags(10); ?>
Tag Cloud
This template tag is used to output a list of the most used tags on your forum in a tag cloud format.
With this template tag, you can specify whether the tag cloud is in descending order, ascending order or random order based on the tag count. You can also specify the tags in the cloud are to have varying text size based on its tag count relationship to the other tags displayed. Tags with higher counts will be larger in font size than tags with smaller tag counts. You are able to specify the min and max tag font sizes. You can also specify the tags to have varying text color based on its tag count relationship to other tags displayed. You specify the min tag color and the max tag color. Tags will be colored between those two value depending on its tag count.
sf_tag_cloud($limit=25, $sort='random', $size=true, $smallest=8, $largest=22, $unit='pt', $color=true, $mincolor='#000000', $maxcolor='#cccccc, $sep=' ');
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $limit | How many tags to show in the list. | Integer | 25 |
| $sort | Sort the tags ascending, descending or randomly by tag count. | asc, desc or random | random |
| $size | Use varying text size for tags. | Boolean | true |
| $smallest | Min text size (see $unit) for tags. | Integer | 8 |
| $largest | Max text size (see $unit) for tags. | Integer | 22 |
| $unit | Units for the varying text size. | pt / px | pt |
| $color | Use varying colors for tags. | Boolean | true |
| $mincolor | Starting color for the varying color tags. | Hex RGB | #000000 |
| $maxcolor | Ending color for the varying color tags. | Hex RGB | #cccccc |
| $sep | separator between tags. | String | space |
User specified styles available for template tag output is:
| Styles | Affected Output |
|---|---|
| a.sftagcloud | Styles the <a> elements of the tag cloud. |
An example usage of the template tag is:
<?php sf_tag_cloud(10, 'desc', true, 10, 30, 'pt', false); ?>
Related Topics
This template tag is used to output a list of the topics that have similar tags.
sf_related_topics($limit=10, $topic_id, $listtags=true, $forum=true, $echo=true)
Possible arguments to the template tag are:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $limit | How many topics to show in the list. | Integer | 10 |
| $topic_id | The topic id for which to find related topics. | Integer | - |
| $listtags | Wrap in <li> tags (li only). | Boolean | true |
| $forum | Display forum name of related topics. | Boolean | true |
| $echo | Write display (returns it if false). | Boolean | true |
User specified styles available for template tag output is:
| Styles | Affected Output |
|---|---|
| li.sftagli | Styles the list elements for each related topic. |
| p.sftagp | Styles the forum name if displayed. |
An example usage of the template tag is:
<?php sf_related_topics(10, 45, true, true, false); ?>
