12 years 2 months ago
Hello,
When using the 'Platform' template, there is a problem with K2 file attachments. The URL to the files is 'broken' in platform which lead to 404 errors.
Platform's URL: /component/k2/item/download/5_0de88371b4afe833bda932380ce0066c.html
K2's default URL:
/component/k2/item/download/5.html
I've taken a look at K2's item .PHP file and noticed that their code to shape the URL was different than yours, with.
**Default item.php code**
<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?></a>
**Platform item.php**
<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>
Replacing the Platform code with the default code solved the problem. Your code