Main icon and thumbnail image

Phoca Download - download manager
mentalhacker
Phoca Member
Phoca Member
Posts: 26
Joined: 14 Jun 2016, 14:28

Main icon and thumbnail image

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47865
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Main icon and thumbnail image

Post by Jan »

Hi, there is an "image" field so you can use the image field for this :idea:

Jan
If you find Phoca extensions useful, please support the project
mentalhacker
Phoca Member
Phoca Member
Posts: 26
Joined: 14 Jun 2016, 14:28

Re: Main icon and thumbnail image

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47865
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Main icon and thumbnail image

Post by Jan »

See, you can display images or YouTube videos in file list (category view):
https://www.phoca.cz/joomlademo/phoca-download-youtube

Jan
If you find Phoca extensions useful, please support the project
mentalhacker
Phoca Member
Phoca Member
Posts: 26
Joined: 14 Jun 2016, 14:28

Re: Main icon and thumbnail image

Post 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? :o
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. :x If it works for thumbnails, it's fantastic, :twisted: but please help, how to use it properly?
Thanks a lot,
mentalhacker
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47865
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Main icon and thumbnail image

Post 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
If you find Phoca extensions useful, please support the project
mentalhacker
Phoca Member
Phoca Member
Posts: 26
Joined: 14 Jun 2016, 14:28

Re: Main icon and thumbnail image

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47865
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Main icon and thumbnail image

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply