Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules: Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#5624 by t_csaba
02 Feb 2018, 14:03
Image
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; ?>

This section only shows the "media" elements of "download" type, unfortunately in the simple view i can't add such items, only images. How could i do the same for the download items?

typo3 8.7.7
php 7.0.16
Linux 2.6
#5626 by aimeos
02 Feb 2018, 17:39
Well, you can upload other files in the "images" tab of the product panel and those will show up in the frontend. Maybe we should better rename that to "media"?

The download tab is only for files you have to buy.
#5727 by t_csaba
22 Feb 2018, 12:03
When uploading a pdf file, it appeared next to the image, icould not change the media type from the simple view of the backend. I have attached some additional screenshots to better explain the problem:
Image

In the expert view, I was able to upload an image with a donwload type, and it showed up in the frontend like this:
Image

But in the simple backend view, my customer is unable to achieve this, and I couldn't find a way either (from backend only, would be possible from PHP, but if it's possible in expert view, it should also be possible in the simple view )