Page 1 of 1

Filelink with image-type icon and file-size?

Posted: Fri Nov 07, 2008 8:41 am
by xmas3
Hi all,
I would like to ask you if it is possible to create a file-link, that will include an image-type before the link and the file-size after the link.
F.e., if I will make a link to a pdf file, I wil get the pdf icon, then the link to a file and at the end the file-size?
Thanks a lot,
Miro

Re: Filelink with image-type icon and file-size?

Posted: Thu Dec 11, 2008 7:57 pm
by zigge
The upload module have exactly this feature.

example:

Create a category in the Upload module admin, add your files and then put in:

{cms_module module="Uploads" category="my_category" mode="summary" template="my_template"}

The template can be modified to your preference. As a example, I like each row to be in a different color:

Code: Select all

<!-- Start Upload Display Template -->

{if isset($input_filter) }
{$startform}
{$prompt_filter}{$input_filter}{$hidden_params}{$input_submit}
{$endform}
<br/>
{$matches} {$matchestext}
{/if}
<div id="skklinks">
<table>
{foreach from=$items item=entry}

  <tr class="{$entry->rowclass}" style="background: {cycle values="#F3E793, #FFFFFF"}"> 
    <td width="720">     
        <img src="{$entry->iconurl}" border="0"/><a href="{$entry->download_url}">{$entry->name} - {$entry->summary} ({$entry->size} Kb)</a>
    </td>
  </tr>
{/foreach}
</table>
</div>
<!-- End Upload Display Template -->
Mats
http://www.skanskakustfiskeklubben.se

Re: Filelink with image-type icon and file-size?

Posted: Sun Dec 28, 2008 6:57 am
by mel
Hi,
Just discover this really simple plugin, that does just one thing: add icon in front of file.
I just change path to modules/FileManager/icons/themes/default/extensions/16px/, containing a lot more icons images.
Keep it simple!
Mel