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

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
t_csaba
Posts: 25
Joined: 12 Oct 2017, 13:28

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

Post 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

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post 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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

t_csaba
Posts: 25
Joined: 12 Oct 2017, 13:28

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

Post 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 )

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post by aimeos » 23 Feb 2018, 00:21

That's possible since 2018.01 in the JQAdm interface as well.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply