Difference between revisions of "Creditstable"

From Sega Retro

(cleaned up, added error message)
Line 1: Line 1:
 
<includeonly><div style="font-size: 90%">{{{1|}}}</div>{{#if: {{{source|}}} |
 
<includeonly><div style="font-size: 90%">{{{1|}}}</div>{{#if: {{{source|}}} |
 
: ''Source: {{{source}}}''{{#if: {{{pdf|}}} |{{fileref|{{{pdf}}}|page={{{pdfpage|}}}}}| [[Category:Credits without reference]] }} | [[Category:Credits without source]] }}
 
: ''Source: {{{source}}}''{{#if: {{{pdf|}}} |{{fileref|{{{pdf}}}|page={{{pdfpage|}}}}}| [[Category:Credits without reference]] }} | [[Category:Credits without source]] }}
<div style="display:none;">
+
{{#vardefine:allLines|{{#replace:{{#replace:{{{1|}}}|'''}}|**|*}}}}{{#vardefine:i|1}}{{#iferror:{{#var:allLines}}|{{#var:allLines}}|
{{#vardefine:currentLine|NULL}}{{#vardefine:i|1}}
+
{{#while:|{{#vardefine:currentLine|{{#explode:{{#var:allLines}}|*|{{#var:i}}}}}}{{#var:currentLine}}
{{#vardefine:allLines|{{#replace:{{#replace:{{{1|}}}|'''}}|**|*}}}}
+
| {{incvar|i}}{{#vardefine:currentLine2|{{striphtml|1={{#var:currentLine}}|removediv=yes}}}}{{clearvar|currentRole|currentNames}}
{{#while:
+
{{#if:{{#pos:{{#var:currentLine2}}|:}}|{{#vardefine:currentRole|{{#explode:{{#var:currentLine2}}|:|0}}}}{{#vardefine:currentNames|{{#explode:{{#var:currentLine2}}|:|1}}}}
| {{#ifexpr:{{#len:{{#var:currentLine}}}} > 3|true|}}
+
|{{#vardefine:currentNames|{{#var:currentLine2}}}}}}{{StoreCreditsLine|role={{#var:currentRole}}|nameList={{#var:currentNames}}|game={{PAGENAME}}|console={{{console|}}}|date={{{date|}}}|source={{{source|}}}|pdf={{{pdf|}}}|pdfpage={{{pdfpage|}}}}}
| {{#vardefine:currentLine|{{#explode:{{#var:allLines}}|*|{{#var:i}}}}}}{{incvar|i}}
+
}}}}{{#if:{{{console|}}}||[[Category:Creditstable with no console field]]}}</includeonly><noinclude>
 
 
{{#if:{{#pos:{{#var:currentLine}}|<}}|{{#vardefine:currentLine2|{{striphtml|1={{#var:currentLine}}|removediv=yes}}}}|{{#vardefine:currentLine2|{{#var:currentLine}}}}}}
 
 
 
{{#if:{{#pos:{{#var:currentLine2}}|:}}|{{
 
#vardefine:currentRole|{{#explode:{{#var:currentLine2}}|:|0}}}}{{
 
#vardefine:currentNames|{{#explode:{{#var:currentLine2}}|:|1}}}}
 
|{{
 
#vardefine:currentRole|}}{{
 
#vardefine:currentNames|{{#var:currentLine2}}}}
 
}}
 
 
 
{{#ifexpr:{{#len:{{#var:currentNames}}}} > 0|
 
{{StoreCreditsLine|role={{#var:currentRole}}|nameList={{#var:currentNames}}|game={{PAGENAME}}|console={{{console|}}}|date={{{date|}}}|source={{{source|}}}|pdf={{{pdf|}}}|pdfpage={{{pdfpage|}}}}}
 
|}}
 
}}{{#if:{{{console|}}}||[[Category:Creditstable with no console field]]}}</div></includeonly><noinclude>
 
 
{{#cargo_declare:
 
{{#cargo_declare:
 
_table=credits
 
_table=credits

Revision as of 23:29, 26 January 2020

This template defines the table "credits". View table.

Usage

Example

{{creditstable|
{{creditsheader|Header}}
* '''Role 1:''' Name
* '''Role 2:''' Name
|source=In-game credits
|console=MD
|pdf=GamePro US 001.pdf
|pdfpage=10
}}
Header
  • Role 1: Name
  • Role 2: Name
Source: In-game credits