I try to show tags, item rating and exztra fields in the search results. I got tags to show, but i fail with rating and extra fields. Can somebody advice me or give a code example? Here is the code to show tags in generic.php:
<?php
$tags = K2ModelItem::getItemTags($item->id);
for ($i=0; $i<sizeof($tags); $i++) {
$tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name));
}
$item->tags=$tags;
?>
<?php if(count($item->tags)): ?>
<!-- Item tags -->
<div class="genericItemTagsBlock">
<span><?php echo JText::_("Tagged under"); ?></span>
<ul class="genericItemTags">
<?php foreach ($item->tags as $tag): ?>
<li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
<?php endforeach; ?>
</ul>
<div class="clr"></div>
</div>
<?php endif; ?>
Thanks in advance for your help! regards chillyB