Difference between revisions of "Template:Download"

From ICPWiki
Jump to: navigation, search
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>http://www.icp.uni-stuttgart.de/~icp/mimetype-icons/{{{3|{{#mediamimesub:{{{1}}}}}}}}.png[[Media:{{{1}}}|{{{2|{{{1}}}}}}]] ({{#mediasize:{{{1}}}}})[[Image:Info_circle.png|link=File:{{{1}}}]]</includeonly><noinclude>
+
<includeonly>{{#ifexist: Media:{{{1}}}|{{SERVER}}/~icp/mimetype-icons/{{{3|{{#replace:{{#mediamime:{{{1}}}}}|/|_}}}}}.png[[Media:{{{1}}}|{{{2|{{{1}}}}}}]] ({{#mediasize:{{{1}}}}})[[Image:Info_circle.png|link=File:{{{1}}}]]|[[Media:{{{1}}}|{{{2|{{{1}}}}}}]] (<span class="error">file does not exist!</span>)}}</includeonly><noinclude>
 
This template can be used to include links to downloadable files.  
 
This template can be used to include links to downloadable files.  
 +
 +
== Usage ==
 +
<code><nowiki>{{Download|</nowiki>''filename''<nowiki>|</nowiki>''linktext''<nowiki>|</nowiki>''type''<nowiki>}}</nowiki></code>
 +
 +
;''filename''
 +
:The name of the file that can be downloaded.
 +
;''linktext''
 +
:The text of the link to the download.
 +
;''type''
 +
:Often, mediawiki cannot deduce the type of the file to be downloaded. In that case, pass the mimetype here.
 
   
 
   
==Examples==
+
== Examples ==
* <tt><nowiki>{{Download|T1w.pdf}}</nowiki></tt> {{Download|T1w.pdf}}
+
* <code><nowiki>{{Download|T1w.pdf}}</nowiki></code> {{Download|T1w.pdf}}
* <tt><nowiki>{{Download|T1c.tgz|An archive|tar}}</nowiki></tt> {{Download|T1c.tgz|An archive|tar}}
+
* <code><nowiki>{{Download|T1c.tgz|An archive|tar}}</nowiki></code> {{Download|T1c.tgz|An archive|tar}}
 +
* <code><nowiki>{{Download|Bla}}</nowiki></code> {{Download|Bla}}
 
</noinclude>
 
</noinclude>

Latest revision as of 09:07, 8 February 2013

This template can be used to include links to downloadable files.

Usage

{{Download|filename|linktext|type}}

filename
The name of the file that can be downloaded.
linktext
The text of the link to the download.
type
Often, mediawiki cannot deduce the type of the file to be downloaded. In that case, pass the mimetype here.

Examples

  • {{Download|T1w.pdf}} application_pdf.pngT1w.pdf (108 KB)Info circle.png
  • {{Download|T1c.tgz|An archive|tar}} tar.pngAn archive (1 KB)Info circle.png
  • {{Download|Bla}} Bla (file does not exist!)