I'm try to show the attachment file in my home menu: K2 » Latest / Latest , the menu don't have the option to show the attachment, i'm try to insert this code in the latest_item.php file but not working!
<?php foreach ($this->item->attachments as $attachment): ?> <a title="<?php echo htmlentities($attachment->titleAttribute, ENT_QUOTES, 'UTF-8'); ?>" href="<?php echo JRoute::_('index.php?option=com_k2&view=item&task=download&id='.$attachment->id); ?>"> <?php echo $attachment->title ; ?> </a> <?php if($this->item->params->get('catItemAttachmentsCounter')): ?> <span>(<?php echo $attachment->hits; ?> <?php echo (count($attachment->hits)==1) ? JText::_("download") : JText::_("downloads"); ?>)</span> <?php endif; ?> <?php endforeach; ?>
How I'm doing wrong?Sorry for my english!
Thanks in advanced.