Difference between revisions of "Ratings"
From Sega Retro
(Undo revision 396794 by Black Squirrel (talk)) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{#vardefine:totalReviews|0}}{{#vardefine:cumulativeScore|0}} | |
{|cellpadding="0" cellspacing="0" class="breakout mw-collapsible mw-collapsed" style="width:auto !important; max-width: 320px; float: right; margin-left: 0px; display: inline; position: relative;" | {|cellpadding="0" cellspacing="0" class="breakout mw-collapsible mw-collapsed" style="width:auto !important; max-width: 320px; float: right; margin-left: 0px; display: inline; position: relative;" | ||
!style="height:39px;" |Sega Retro Average | !style="height:39px;" |Sega Retro Average | ||
Line 8: | Line 8: | ||
!class="sortable"|Score | !class="sortable"|Score | ||
!Source | !Source | ||
− | |||
|- | |- | ||
{{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}{{#vardefine: lastargtype|null}}{{#vardefine:thisIsARating|true}} | {{#vardefine:argpubname|null}}{{#vardefine:argpubscore|null}}{{#vardefine:argpubsource|}}{{#vardefine: newrow|false}}{{#vardefine: lastargtype|null}}{{#vardefine:thisIsARating|true}} | ||
Line 33: | Line 32: | ||
{{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 44: | Line 42: | ||
{{#ifeq: {{#var: argpubname}}|null|| | {{#ifeq: {{#var: argpubname}}|null|| | ||
{{#ifeq: {{#var: argpubscore}}|null|| | {{#ifeq: {{#var: argpubscore}}|null|| | ||
− | + | ||
{{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|0|noissuename=yes|nopubdate=yes}}}} | {{#vardefine:magnamelong|{{MagazineName|{{#var: argpubname}}|0|noissuename=yes|nopubdate=yes}}}} | ||
{{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}} | {{RatingsRowSum|{{#var: magnamelong}}|{{#var: argpubscore}}|{{#var: argpubsource}}}} | ||
Line 52: | Line 50: | ||
}} | }} | ||
}} | }} | ||
− | |||
<!-- Calculate average --> | <!-- Calculate average --> | ||
Line 60: | Line 57: | ||
}} | }} | ||
|} | |} | ||
− | |} | + | |} |
{|cellpadding="0" cellspacing="0" class="breakout" style="width:auto !important; float: right; margin-left: 15px; display: inline; position: relative;" | {|cellpadding="0" cellspacing="0" class="breakout" style="width:auto !important; float: right; margin-left: 15px; display: inline; position: relative;" | ||
! style="max-width:40px; height:40px"| {{{{{icon}}}|L}}{{#if: {{{icon|}}} | | [[Category:Old Ratings Template]]}} | ! style="max-width:40px; height:40px"| {{{{{icon}}}|L}}{{#if: {{{icon|}}} | | [[Category:Old Ratings Template]]}} | ||
! style="max-width:40px;" style="font-size:16pt; {{scoreColour|{{#var: average}}}}"|{{#var: average}} | ! style="max-width:40px;" style="font-size:16pt; {{scoreColour|{{#var: average}}}}"|{{#var: average}} | ||
|- | |- | ||
− | |colspan="2" style="padding:2px; text-align:center; line-height:initial" | <small>Based on<br>'''{{#var: totalReviews}}''' review{{#ifexpr: {{#var: totalReviews}} > 1|s| }}</small> | + | |colspan="2" style="padding:2px; text-align:center; line-height:initial" | <small>{{#vardefine:totalText|Based on<br>'''{{#var: totalReviews}}''' review{{#ifexpr: {{#var: totalReviews}} > 1|s| }}}}{{#var:totalText}}</small> |
|} | |} | ||
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> | <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> |
Revision as of 17:02, 21 August 2017
Sega Retro Average | |||
---|---|---|---|
|
{{{{{icon}}}|L}} | Division by zero. |
---|---|
Based on 0 review |
<meta itemprop="ratingValue" content="Division by zero.">
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.