Difference between revisions of "Ratings"

From Sega Retro

Line 20: Line 20:
 
{{#vardefine: key|{{#replace:{{#var:key}}|_4|}}}}
 
{{#vardefine: key|{{#replace:{{#var:key}}|_4|}}}}
  
 +
<!-- Determine which argument we're dealing with (icon, pubname, pubscore etc.) -->
 
{{#vardefine:argtype|score}}
 
{{#vardefine:argtype|score}}
 
{{#ifeq: {{#var: key}}|icon|{{#vardefine:argtype|icon}}|
 
{{#ifeq: {{#var: key}}|icon|{{#vardefine:argtype|icon}}|
Line 29: Line 30:
 
<!-- -->
 
<!-- -->
 
{{#ifeq: {{#var: argtype}}|score|{{#ifeq: {{#var: lastargtype}}|score|
 
{{#ifeq: {{#var: argtype}}|score|{{#ifeq: {{#var: lastargtype}}|score|
{{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|0|noissuename=yes|nopubdate=yes}}}}
+
{{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|noissuename=yes|nopubdate=yes}}}}
 
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}[[Category:Rating without source]]
 
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}[[Category:Rating without source]]
|}}|}}
+
|}}|}}  
  
 
{{#ifeq: {{#var: argtype}}|score|{{#vardefine:argpubname|{{#var: key}}}}{{#vardefine:argpubscore|{{#var: value}}}}|}}
 
{{#ifeq: {{#var: argtype}}|score|{{#vardefine:argpubname|{{#var: key}}}}{{#vardefine:argpubscore|{{#var: value}}}}|}}
Line 43: Line 44:
 
{{#ifeq: {{#var: argpubscore}}|null||
 
{{#ifeq: {{#var: argpubscore}}|null||
  
{{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|0|noissuename=yes|nopubdate=yes}}}}
+
{{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|noissuename=yes|nopubdate=yes}}}}
 
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}
 
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}}
 
{{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}
 
{{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}
Line 104: Line 105:
 
All fields are optional.
 
All fields are optional.
  
 +
==Examples==
 +
{{ratings
 +
| icon=MD
 +
| consolesplus=47
 +
| consolesplus_source={{num|14|page=114/115}}
 +
}}
 
[[Category:Breakout box templates]]</noinclude>
 
[[Category:Breakout box templates]]</noinclude>

Revision as of 13:43, 14 July 2018

Sega Retro Average 
Publication Score Source
{{{{{icon}}}|L}} Division by zero.
Based on
0 review

<meta itemprop="ratingValue" content="Division by zero.">

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

Usage

This template is to be used on articles about video games and will display scores awarded to said games by video game magazines/websites.

Usage:

{{Ratings
| icon=
| publication=
}}

Substitute "publication" with a publication code to get the desired result.

for sources, add "_source", e.g.

| smf_source=[http://www.google.com]
| vgce_source={{num|32|page=10/11}}

All fields are optional.

Examples

Sega Retro Average 
Publication Score Source
47 №14, p114/115
Sega Mega Drive
47
Based on
1 review