Difference between revisions of "Fileref"

From Sega Retro

(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>Template for file references.
+
<noinclude>{{#cargo_declare:
 +
_table = filerefs
 +
| name=text
 +
| file=text
 +
| filepage=integer
 +
}}
 +
Template for file references.
  
 +
==Usage==
 
Parameters:
 
Parameters:
 
* 1: Filename.
 
* 1: Filename.
 
* page: Page number. Used for multi-page PDF documents.
 
* page: Page number. Used for multi-page PDF documents.
 +
* quote: A specific quote, helpful if referencing long pages
  
 
Examples:
 
Examples:
 
* <nowiki>GoldenAxe Title.png{{fileref|GoldenAxe Title.png}}</nowiki> &rarr; GoldenAxe Title.png{{fileref|GoldenAxe Title.png}}
 
* <nowiki>GoldenAxe Title.png{{fileref|GoldenAxe Title.png}}</nowiki> &rarr; GoldenAxe Title.png{{fileref|GoldenAxe Title.png}}
 
* <nowiki>Golden Axe Mega Drive US manual, page 32{{fileref|GoldenAxe MD US Manual.pdf|page=19}}</nowiki> &rarr; Golden Axe Mega Drive US manual, page 19{{fileref|GoldenAxe MD US Manual.pdf|page=19}}
 
* <nowiki>Golden Axe Mega Drive US manual, page 32{{fileref|GoldenAxe MD US Manual.pdf|page=19}}</nowiki> &rarr; Golden Axe Mega Drive US manual, page 19{{fileref|GoldenAxe MD US Manual.pdf|page=19}}
 +
* <nowiki>Seaman DC JP Box Back.jpg{{fileref|Seaman DC JP Box Back.jpg}}</nowiki> &rarr; Seaman DC JP Box Back.jpg{{fileref|Seaman DC JP Box Back.jpg}}
 +
* <nowiki>Testing quotes{{fileref|Seaman DC JP Box Back.jpg|quote=Quotey McQuoteface}}</nowiki> &rarr; Testing quotes{{fileref|Seaman DC JP Box Back.jpg|quote=Quotey McQuoteface}}
  
 
==See also==
 
==See also==
Line 17: Line 27:
  
 
[[Category:Sega Retro templates]]
 
[[Category:Sega Retro templates]]
</noinclude><includeonly>{{#vardefine:filename|{{{1}}}}}<span style="display:none;">[[Media:{{#var:filename}}]]</span>{{#tag: ref | {{#if: {{{page|}}} | [{{fullurl:File:{{#replace:{{#var:filename}}| |_}}|page={{{page}}}}} File:{{#var:filename}}, page {{{page}}}] | [[:File:{{#var:filename}}]]}} | name=":File:{{#var:filename}}{{#if: {{{page|}}} | _p{{{page}}}}}" }}</includeonly>
+
</noinclude><includeonly>{{#vardefine:filename|{{{1|}}}}}{{FilerefStore
 +
| name={{FULLPAGENAME}}
 +
| file={{#var:filename}}
 +
| page={{{page|}}}
 +
}}{{#vardefine:reftext|{{GetRefInfo|{{#var:filename}}}}}}{{#vardefine:quote|{{{quote|}}}}}{{#if:{{#var:reftext}}||{{#vardefine:reftext|File:{{#var:filename}}}}}}{{#tag: ref | {{#if:{{#var:quote}}|"{{#var:quote}}",&nbsp;}}{{#if: {{{page|}}} | [{{fullurl:File:{{#var:filename}}|page={{{page|}}}}} {{#var:reftext}}, page {{{page|}}}] | [[:File:{{#var:filename}}|{{#var:reftext}}]]}} | name=":File:{{#var:filename}}_p{{{page|}}}{{#var:quote}}" }}{{incvar|refcount}}{{clearvar|reftext|quote}}</includeonly>

Revision as of 06:27, 25 July 2021

This template defines the table "filerefs". View table. Template for file references.

Usage

Parameters:

  • 1: Filename.
  • page: Page number. Used for multi-page PDF documents.
  • quote: A specific quote, helpful if referencing long pages

Examples:

  • GoldenAxe Title.png{{fileref|GoldenAxe Title.png}} → GoldenAxe Title.png[1]
  • Golden Axe Mega Drive US manual, page 32{{fileref|GoldenAxe MD US Manual.pdf|page=19}} → Golden Axe Mega Drive US manual, page 19[2]
  • Seaman DC JP Box Back.jpg{{fileref|Seaman DC JP Box Back.jpg}} → Seaman DC JP Box Back.jpg[3]
  • Testing quotes{{fileref|Seaman DC JP Box Back.jpg|quote=Quotey McQuoteface}} → Testing quotes[4]

See also

  • Template:Ref for referencing other pages on the wiki or other sites in general.

References

Since this template uses the <ref> tag, all pages that use this template will have an auto-generated references list appended to the end of the page. To prevent confusion, a <references/> tag should be added to the end of the page in a dedicated "References" section, such as this one.