Page 1 of 2

Phoca Download Plugin - Icons

Posted: 02 Apr 2009, 18:56
by korvax
Hey there,

i just tested the Phoca Download Plugin and it works great. The only thing i'm missing is, that when you link a file directly the icon of the file is always the same (harddrive with arrow).
Is it possible to show the icon provided (add file dialog) next to it and not just a standard icon? That would be really great. The reason is, that i display a language flag next to the files, if i link through the download plugin, you can't see in what language that file content is.

I would really appreciate it.
Thanks in advance and for the great download-component.

Re: Phoca Download Plugin - Icons

Posted: 02 Apr 2009, 21:57
by Jan
Hi, now you can change the size of the icon, I will take a look at it, maybe I will find some behaviour how to paste there custom image.

Jan

Re: Phoca Download Plugin - Icons

Posted: 05 Mar 2010, 07:47
by dax702
I too am interested in this idea. With the download plugin, I want to insert a PDF file, and would like to show a PDF icon to the user. I suppose I could just overwrite the /plugins/content/phocadownload/images/icon-download-64.png file, but what if I need to show some other type of file besides PDF? There should be a way to change the icon in the plugin But very nice plugin overall for sure! :twisted:

Re: Phoca Download Plugin - Icons

Posted: 06 Mar 2010, 23:52
by Jan
Hi, yes, it is in feature request list. Not the only limitation factor is the time :-(

Re: Phoca Download Plugin - Icons

Posted: 18 Jul 2011, 18:06
by xcore
Just wanted to express my "vote" for this feature. Icon based on filetype seems essential to me.

Thanks!

Re: Phoca Download Plugin - Icons

Posted: 30 Nov 2011, 11:41
by simon.howell
This has also got my vote with one minor tweak - the ability to have no icon sometimes. For example sometimes I need to include a link to a file in the middle of a sentence. I don't want an icon to appear in this instance but I may want the icons in a list of links.

Could this be added as an attribute e.g. "icon=pdf | xls | doc | img | mov | mp3 | no"?

Re: Phoca Download Plugin - Icons

Posted: 23 Mar 2012, 17:10
by Demonike
The Add File form has a field for custom file icon, it only seems not to be implemented in the plugin (the plugin only shows generic icon). Being able to override in the code attributes that you insert into the article seems to be the way to go if you need this file linked without its icon once in a while, but an a general option might be useful as well, if this is the way you need your files linked most of the time and only exceptionally need an icon for a file. Via general option this behavior could be swapped and then overridden for specific places when needed.

A good idea, I vote "for".
As of Phoca Download Plugin v 2.1.6 this functionality is still missing.

Re: Phoca Download Plugin - Icons

Posted: 23 Mar 2012, 17:41
by Demonike
korvax wrote:Is it possible to show the icon provided (add file dialog) next to it and not just a standard icon? That would be really great. The reason is, that i display a language flag next to the files, if i link through the download plugin, you can't see in what language that file content is.
This is an ancient post, but it is relatively simple to achieve this with only CSS overrides.
Since you call out this plugin via text code, you can wrap the code into a proprietary DIV, for example:

Code: Select all

<div class="download-icon-pdf">
   {phocadownload view=filelist|id=2}
</div>
Then, in your template folder, there should be a CSS folder and in it you can create if not existing already, "custom.css". You will store all your template overrides in that document. The override goes like this:

Code: Select all

.download-icon-pdf .phocadownloadfilelist {
background:none; 
border:none;
}
.download-icon-pdf .phocadownloadfilelist32 {
border-bottom: 1px solid #EEE;
background: transparent url(../images/icon-pdf-32.png) 5px center no-repeat;
}
What happens here, is that we effectively isolate the .phocadownloadfilelist32 class from other instances and only achieve this look where we specifically want this (permits the use of other icons elsewhere on the page, but not in the same set, unfortunately, - we will keep waiting for the proper custom icon support in Phoca Download Plugin).

.phocadownloadfilelist regulates the area around the file-block and
.phocadownloadfilelist32 regulates the individual file container block and the 32 depends on the icon size chosen from the general options.

Then place an image file with the content and dimensions (32x32 in this case) of your liking to your "images" directory withing your template directory.

Code: Select all

../your-template/images/icon-pdf-32.png

Re: Phoca Download Plugin - Icons

Posted: 29 Mar 2012, 01:38
by Demonike
I figured it out.
Jan, this will take 30min max for you to implement properly :)

Code: Select all

plugins/content/phocadonwload/phocadownload.php
Go to FILELIST section (around line 230).
Into the SELECT query add somewhere "a.image_filename,"
Goto line 272, modify to the following:

Code: Select all

} else {
$link = PhocaDownloadHelperRoute::getFileRoute($item->id,$item->catid,$item->alias,$item->catalias, 0, 'download');
$icon = $item->image_filename;
}
$output .= '<div class="phocadownloadfilelist'.(int)$iSize.'" style="background:url(../images/phocadownload/'.$icon.') 5px center no-repeat;"><a href="'. JRoute::_($link).'" '.$targetOutput.'>'. $textOutput.'</a></div>';
}
This might not be the most elegant way (hardcoding CSS), but it gets results. Since the icon is displayed as a background image for a div, the other way would be to include PHP code in CSS and THAT is a mess, I have seen it :wink:

Re: Phoca Download Plugin - Icons

Posted: 02 Apr 2012, 23:30
by Jan
Hi, thank you for the guide.

Jan