Difference between revisions of "Template:Rawfiledownloadexample"

From YobiWiki
Jump to navigation Jump to search
(First version)
 
(Use name for the link as well)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
You can download file "{{{name}}}" below, just click this link: {{#tag:file|download|name={{{name}}}|tag=pre}}.
+
You can download file "{{{name}}}" below, just click this link: {{#tag:file|{{{name}}}|name={{{name}}}|tag=pre}}.
 
{{#tag:pre|{{{content}}}}}
<pre>
 
{{{content}}}
 
</pre>
 
 
<noinclude>
 
<noinclude>
 
<hr/>
 
<hr/>

Latest revision as of 11:06, 17 February 2014

You can download file "{{{name}}}" below, just click this link: <file name="{{{name}}}" tag="pre">{{{name}}}</file>.

{{{content}}}

This is an example template to demonstrate how to use the RawFile extension tags in a template.

The special construct {{#tag:file|...}} is a work-around to a bug in mediawiki template expansion (see bugzilla 61341). See Mediawiki RawFile for more information.

Example of use:

{{Rawfiledownloadexample|name=myfile.txt|content=Once upon a time
There was a Tag
Tag was clickable
And clicked it was}}

You can download file "myfile.txt" below, just click this link: <file name="myfile.txt" tag="pre">myfile.txt</file>.

Once upon a time
There was a Tag
Tag was clickable
And clicked it was