Page 1 of 1

How do i show download attributes(pdf) in frontend?

Posted: 02 Feb 2018, 14:03
by t_csaba
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

Re: How do i show download attributes(pdf) in frontend?

Posted: 02 Feb 2018, 17:39
by aimeos
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.

Re: How do i show download attributes(pdf) in frontend?

Posted: 22 Feb 2018, 12:03
by t_csaba
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 )

Re: How do i show download attributes(pdf) in frontend?

Posted: 23 Feb 2018, 00:21
by aimeos
That's possible since 2018.01 in the JQAdm interface as well.