How do i show download attributes(pdf) in frontend?
Posted: 02 Feb 2018, 14:03
In the simple view of the aimeos shop, there is a "Downloads" tab. If my customer uploads there a pdf file, how do i show it as a downloadable document in the frontend?
Code: Select all
<?php if( ( $mediaItems = $this->detailProductItem->getRefItems( 'media', null, 'download' ) ) !== [] ) : ?>
<div class="additional-box">
<h2 class="header downloads"><?= $enc->html( $this->translate( 'client', 'Downloads' ), $enc::TRUST ); ?></h2>
<ul class="content downloads">
<?php foreach( $mediaItems as $id => $item ) : ?>
<?php if( isset( $mediaList[$id] ) ) { $item = $mediaList[$id]; } ?>
<li class="item">
<a href="<?= $this->content( $item->getUrl() ); ?>" title="<?= $enc->attr( $item->getName() ); ?>">
<img class="media-image"
src="<?= $this->content( $item->getPreview() ); ?>"
alt="<?= $enc->attr( $item->getName() ); ?>"
/>
<span class="media-name"><?= $enc->html( $item->getName() ); ?></span>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
typo3 8.7.7
php 7.0.16
Linux 2.6