Difference between revisions of "Template:DownloadExt"

From ICPWiki
Jump to navigation Jump to search
(Restore older version)
Line 1: Line 1:
<includeonly>[{{SERVER}}/~icp/html{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#explode:{{{1}}}|/|-1}}}}]</includeonly><noinclude>
+
<includeonly>{{#if:{{#extmediaurl:{{{1}}}}}|[{{#extmediaurl:{{{1}}}}} {{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}] ({{#extmediasize:{{{1}}}}})|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}} (<span class="error">unknown file</span>)}}</includeonly><noinclude>
 
This template can be used to include links to downloadable files that have not been uploaded to mediawiki but reside somewhere else.  
 
This template can be used to include links to downloadable files that have not been uploaded to mediawiki but reside somewhere else.  
  
 
== Usage ==
 
== Usage ==
<code><nowiki>{{DownloadExt|</nowiki>''filename''<nowiki>|</nowiki>''linktext''<nowiki>|</nowiki>''type''<nowiki>}}</nowiki></code>
+
<code><nowiki>{{DownloadExt|</nowiki>''filename''<nowiki>|</nowiki>''linktext''<nowiki>}}</nowiki></code>
  
 
;''filename''
 
;''filename''
:The name of the file that can be downloaded, relative to the path <code>/web/icp/public_html/html/</code>
+
:The name of the file that can be downloaded, in a folder specified in the LocalSettings.php
 
;''linktext''
 
;''linktext''
 
:The text of the link to the download.
 
: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 ==
* <code><nowiki>{{DownloadExt|/teaching/2012-ws-sim_methods/slides01.pdf}}</nowiki></code> {{DownloadExt|/teaching/2012-ws-sim_methods/slides01.pdf}}
+
* <code><nowiki>{{DownloadExt|slides01.pdf}}</nowiki></code>: {{DownloadExt|slides01.pdf}}
* <code><nowiki>{{DownloadExt|/teaching/2012-ws-sim_methods/slides01.pdf|Lecture Slides}}</nowiki></code> {{DownloadExt|/teaching/2012-ws-sim_methods/slides01.pdf|Lecture Slides}}
+
* <code><nowiki>{{DownloadExt|harting07a.pdf}}</nowiki></code>: {{DownloadExt|harting07a.pdf}}
 +
*<code><nowiki>{{DownloadExt|bla|test}}</nowiki></code>: {{DownloadExt|bla|test}}
 +
*<code><nowiki>{{DownloadExt|bla}}</nowiki></code>: {{DownloadExt|bla}}
 
</noinclude>
 
</noinclude>

Revision as of 12:40, 17 June 2013

This template can be used to include links to downloadable files that have not been uploaded to mediawiki but reside somewhere else.

Usage

{{DownloadExt|filename|linktext}}

filename
The name of the file that can be downloaded, in a folder specified in the LocalSettings.php
linktext
The text of the link to the download.

Examples

  • {{DownloadExt|slides01.pdf}}: slides01.pdf (unknown file)
  • {{DownloadExt|harting07a.pdf}}: harting07a.pdf (unknown file)
  • {{DownloadExt|bla|test}}: test (unknown file)
  • {{DownloadExt|bla}}: bla (unknown file)