If you don't feel like disabling security, you can also loop through the tags, searching for your specific entry:
Code: Select all
{foreach from=$entry.properties.freetag_tags item='tag'}
{if $tag == 'MY_TAG'}<img src="my icon" />{/if}
{/foreach}
Of course, you might not like to waste time in the looping. In that case, you could provide your own Smarty function in the template's config.inc.php:
Code: Select all
<?php
global $serendipity;
$serendipity['smarty']->register_function('tag_icon', 'template_tag_icon');
function template_tag_icon($params, &$smarty)
{
if(empty($params['tags'])) {
return;
}
if(empty($params['name'])) {
return;
}
if (in_array('MY_TAG', $params['tags'])) {
$img_data = array('src' => 'MY_TAG_IMG_SRC',
'alt' => 'MY_TAG_ALT_TEXT');
$smarty->assign($params['name'], $img_data);
} else {
$smarty->assign($params['name'], '');
return;
}
?>
And then in your template:
Code: Select all
{tag_icon tags=$entry.properties.freetag_tags name='tag_img'}
{if $tag_img}<img src="{$tag_img.src}" alt="{$tag_img.alt}" />{/if}
Besides not turning off security, you also get to assign additional information (like the alt tag), and you can look up more than one tag, or provide different icons depending on which information is most important to you.