Difference between revisions of "Ref2"

From Sega Retro

Line 1: Line 1:
 
<includeonly>{{#vardefine:reflink|}}{{#if: {{#pos:{{{1}}}|http://}}{{#pos:{{{1}}}|https://}}{{#pos:{{{1}}}|ftp://}}
 
<includeonly>{{#vardefine:reflink|}}{{#if: {{#pos:{{{1}}}|http://}}{{#pos:{{{1}}}|https://}}{{#pos:{{{1}}}|ftp://}}
 
|{{#vardefine:refcontent|{{{1}}}}}<!-- Ref is a link. Use text as-is. -->
 
|{{#vardefine:refcontent|{{{1}}}}}<!-- Ref is a link. Use text as-is. -->
|{{#vardefine:refcontent|File:{{{1}}}{{#if:{{{page|}}}|, page {{{page}}}}}}}<!-- Ref is a file. -->
+
|{{#switch: {{fileext|{{{1}}}}} | png|jpg|jpeg|zip|7z|pdf={{#vardefine:refcontent|File:{{{1}}}{{#if:{{{page|}}}|, page {{{page}}}}}}}<!-- Ref is a file. -->
 +
|#default={{#vardefine:refcontent|[[{{{1}}}]]}}<!-- Ref is an internal link. -->
 +
}}
 
}}{{#loop:i
 
}}{{#loop:i
 
|1
 
|1
Line 17: Line 19:
 
This is an example.{{ref2|http://google.com}} And another example.{{ref2|http://en.wikipedia.org}} Same as first.{{ref2|http://google.com}} Third.{{ref2|http://sonicretro.org}}
 
This is an example.{{ref2|http://google.com}} And another example.{{ref2|http://en.wikipedia.org}} Same as first.{{ref2|http://google.com}} Third.{{ref2|http://sonicretro.org}}
  
This is a fileref.{{ref2|CVG UK 090.pdf|page=12}} Fileref without page.{{ref2|Sonic1 title.png}}
+
This is a fileref.{{ref2|CVG UK 090.pdf|page=12}} Fileref without page.{{ref2|Sonic1 title.png}} Internal ref.{{ref2|Sega Master System}}
  
 
{{#var:refcount}}
 
{{#var:refcount}}
 
{{refs}}
 
{{refs}}
 
</noinclude>
 
</noinclude>

Revision as of 14:19, 19 August 2016


Usage

This is an example.[1] And another example.[2] Same as first.[1] Third.[3]

This is a fileref.[4] Fileref without page.[5] Internal ref.[6]

6

  1. 1.1 1.2  http://google.com
  2. http://en.wikipedia.org
  3. http://sonicretro.org
  4. File:CVG UK 090.pdf, page 12Media:CVG UK 090.pdf
  5. File:Sonic1 title.pngMedia:Sonic1 title.png
  6. Sega Master System