Template:LLink: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(Testing a new category)
 
(replaced template:Switch with parser function #if)
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
&nbsp;&nbsp;&nbsp;(&nbsp;{{switch|{{{1|}}}|case:= |default=[http://www.cpdl.org/wiki/images/{{{1}}} {{pdf}}]&nbsp;}}{{switch|{{{2|}}}|case:= |default=[http://www.cpdl.org/wiki/images/{{{2}}} {{mid}}]&nbsp;}}{{switch|{{{3|}}}|case:= |default=[http://www.cpdl.org/wiki/images/{{{3}}} {{{4}}}]&nbsp;}}{{switch|{{{5|}}}|case:= |default=[http://www.cpdl.org/wiki/images/{{{5}}} {{{6}}}]&nbsp;}})<noinclude>[[Category:Templates|{{PAGENAME}}]]</noinclude>
<includeonly>&nbsp; ( {{#if:{{{1|}}}|[{{filepath:{{{1}}}}} {{pdf}}]&nbsp;}}{{#if:{{{2|}}}|[{{filepath:{{{2}}}}} {{ {{lc:{{#explode:{{{2|}}}|.|-1}}}} }}]&nbsp;}}{{#if:{{{3|}}}|[{{filepath:{{{3}}}}} {{{4}}}]&nbsp;}}{{#if:{{{ext1|}}}|[http://{{{ext1}}}]&nbsp;}}{{#if:{{{ext2|}}}|[http://{{{ext2}}}]&nbsp;}}{{#if:{{{ext3|}}}|[http://{{{ext3}}}]&nbsp;}}{{#if:{{{ext4|}}}|[http://{{{ext4}}}]&nbsp;}}{{#if:{{{ext5|}}}|[http://{{{ext5}}}]&nbsp;}}{{#if:{{{media|}}}|[[Media:{{{media}}}|{{{type}}}]]&nbsp;}})</includeonly><noinclude>
{{Doc|text=
Creates links with icons to local media (ie. "Image:") files hosted at CPDL.org.
 
1st optional parameter is the name (without "{{SERVER}}/wiki/images/x/xy/") of the local PDF file (eg. MyEdition.pdf, which is found at Image:MyEdition.pdf)
 
2nd optional parameter is the name (without "{{SERVER}}/wiki/images/x/xy/") of the local MID file (eg. MyEdition.mid, which is found at Image:MyEdition.mid)
 
3rd optional parameter is the name (without "{{SERVER}}/wiki/images/x/xy/") of the local source file (eg. MyEdition.enc,, which is found at Image:MyEdition.enc)
 
4th optional parameter is the program name (eg. Encore) or icon corresponding to the source file from the 3rd parameter.
 
ext1-ext5 are optional parameters with links (without "http://") to any other local or external file, PLUS a space, PLUS the program name (Encore etc.) or an icon template, like {{extpdf}}
 
The parameters media=''filename'', type=''filetype'' may also be used to create a Mediawiki link of the form <nowiki>[[Media:</nowiki> ''filename'' <nowiki>|</nowiki> ''filetype'' <nowiki>]]</nowiki>. The type parameter must be plain text; using an icon breaks Mediawiki links.
}}
<p>{{prot-temp}}</p>
[[Category:Internal link templates]]
</noinclude>

Latest revision as of 18:07, 16 June 2017


Documentation

Creates links with icons to local media (ie. "Image:") files hosted at CPDL.org.

1st optional parameter is the name (without "https://www.cpdl.org/wiki/images/x/xy/") of the local PDF file (eg. MyEdition.pdf, which is found at Image:MyEdition.pdf)

2nd optional parameter is the name (without "https://www.cpdl.org/wiki/images/x/xy/") of the local MID file (eg. MyEdition.mid, which is found at Image:MyEdition.mid)

3rd optional parameter is the name (without "https://www.cpdl.org/wiki/images/x/xy/") of the local source file (eg. MyEdition.enc,, which is found at Image:MyEdition.enc)

4th optional parameter is the program name (eg. Encore) or icon corresponding to the source file from the 3rd parameter.

ext1-ext5 are optional parameters with links (without "http://") to any other local or external file, PLUS a space, PLUS the program name (Encore etc.) or an icon template, like Icon_pdf_globe.gif

The parameters media=filename, type=filetype may also be used to create a Mediawiki link of the form [[Media: filename | filetype ]]. The type parameter must be plain text; using an icon breaks Mediawiki links.