Page 1 of 1
Main icon and thumbnail image
Posted: 20 Jun 2017, 13:53
by mentalhacker
Hi,
In the Icon field you can use "phocathumbnail-" string so the system knows that it's not an icon next to the file but an image thumbnail above the file name.
Is it possible to separate the functions with two different fields in the backend? One for the main icon and one for the thumbnail image?
In this case there would be no need to insert the string. There can be websites that contain several hundreds of downloadable files with thumbnail images. Renaming each files and copying the string into each file name can be very frustrating and annoying. A separate function with its own field would be a neat solution.
Thanks a lot.
Best regards,
mentalhacker
Re: Main icon and thumbnail image
Posted: 21 Jun 2017, 16:35
by Jan
Hi, there is an "image" field so you can use the image field for this
Jan
Re: Main icon and thumbnail image
Posted: 21 Jun 2017, 16:52
by mentalhacker
Yes, there is an image field, but that image is only displayed in the details view when you hover the mouse over the Detail button. Unfortunately that is not a permanent thumbnail image. Or do I use this field in the wrong way?
Re: Main icon and thumbnail image
Posted: 25 Jun 2017, 20:56
by Jan
See, you can display images or YouTube videos in file list (category view):
https://www.phoca.cz/joomlademo/phoca-download-youtube
Jan
Re: Main icon and thumbnail image
Posted: 26 Jun 2017, 11:19
by mentalhacker
Hey, did I miss something?
Did you use only the Image field on this demo page, and you didn't use the Icon field with the 'phocathumbnail-' string?
If yes, I'm a bit confused because I've read all the documentation, and in 3.1.2 the only option to display thumbnail image is using the Icon field with 'phocathumbnail-' string before the file name. Using the Image field for this purpose doesn't work.

If it works for thumbnails, it's fantastic,

but please help, how to use it properly?
Thanks a lot,
mentalhacker
Re: Main icon and thumbnail image
Posted: 27 Jun 2017, 16:00
by Jan
Hi, on the site, the layout is build with the layout, so the image is added to the site with the layout.
You can even customize it per template or in default view, the image is in this variable:
Code: Select all
if ($v->image_download != '') {
echo '<div class="pd-image">'.$l->getImageDownload($v->image_download).'</div>';
}
components\com_phocadownload\views\category\tmpl\default_files.php
Jan
Re: Main icon and thumbnail image
Posted: 18 Sep 2017, 22:37
by mentalhacker
Hi Jan,
Thanks for the code. It works, but it needed some modifications because in this form the image is displayed outside the filenamebox. When I put it inside the filenamebox, the image is displayed perfectly. I used this code:
Code: Select all
$pdFile .= '<div class="pd-filename">' .$linkDownloadB . $imageFileName['filenamethumb'] .'</div>' .$linkDownloadE
. '<div class="pd-image">' .$linkDownloadB .$l->getImageDownload($v->image_download) .'</div>' .$linkDownloadE
. '<div class="pd-document'.$this->t['file_icon_size'].'" '
. $imageFileName['filenamestyle'].'>';
This part contains both main icon with 'phocathumbnail-' string and thumbnail image using 'Image' field. The editor can choose which he/she wants to use for displaying an image. Both types of image are linked.
Thanks a lot,
mentalhacker
Re: Main icon and thumbnail image
Posted: 19 Sep 2017, 17:21
by Jan
Ok