Difference between revisions of "Ref2"
From Sega Retro
(One intermediate revision by the same user not shown) | |||
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}} | ||
+ | [[Category:Experimental templates]] | ||
</noinclude> | </noinclude> |