K2 items doen´t show attachements

Creative, responsive and unique Joomla template to create personal portfolio website with amazing animations and clean design.
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sat Mar 19, 2016 12:15 pm
Reply with quote
Report this post
(Excuse my english)

I am adding some pdfs with the attachements option in k2 but when I check the item in the browser they are not there, do I have to do something to show them?
User avatar
Fresh Boarder

teitbite
Wed Mar 23, 2016 1:34 pm
Reply with quote
Report this post
Hi

Please edit /html/com_k2/templates/default/item.php and add this code to where You wish attached files should be displayed.

Code: Select all
     <?php if($this->item->params->get('itemAttachments') && count($this->item->attachments)): ?>
     <!-- Item attachments -->
     <div class="itemAttachmentsBlock">
        <span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span>
        <ul class="itemAttachments">
          <?php foreach ($this->item->attachments as $attachment): ?>
          <li>
             <a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?></a>
             <?php if($this->item->params->get('itemAttachmentsCounter')): ?>
             <span>(<?php echo $attachment->hits; ?> <?php echo ($attachment->hits==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span>
             <?php endif; ?>
          </li>
          <?php endforeach; ?>
        </ul>
     </div>
     <?php endif; ?>

      <div class="clr"></div>
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.