On November 27th, 2022, the 8,000th article was added to the SuccuWiki!

Template:Rating

From SuccuWiki - The Wiki of the Succubi
Revision as of 09:41, 15 October 2012 by TeraS (talk | contribs) (Created page with "{{#if:{{{1|}}} |<span style="white-space:nowrap" title="{{{score|{{#if:{{{2|}}}|{{{1}}}/}}{{plural|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}|{{{rating|star}}}|{{{rating-plural|{{{rati...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Please specify a rating.

[edit] [history] [purge] Documentation icon Template documentation

This template is designed to provide an image rating system, defaulting to stars. The template accepts ratings of up to ten, with more than six appearing reduced in size.

When to use this template

The template works with whole and half ratings. Other rating fractions will be rounded and the page on which the template resides will be inserted into the maintenance category Category:Pages with incorrect use of Rating template.

Please only use this template if the rating was originally expressed with the images used. For example, if a reviewer awards something a rating of "4" (expressed in digits not stars) on a scale of 5, you should simply write it as "4" or "4/5" in your article, depending on how it is presented by the source. Do not use {{rating|4|5}} where the source does not use stars, because it is inaccurate and misleading. Note that ratings on a scale of 10 can be hard to read if expressed visually with images.

Default parameters

These are the only parameters you need to show star ratings, the default symbols.

  • The first unnamed parameter is the number of the rating received.
  • The second unnamed parameter is optional, and is the maximum possible for the rating system. This will show empty or blank elements for the remainder above the rating, and changes the text in the tooltip to add "/x".
Examples
4/5 starsFile:Star empty.svg {{rating|4|5}}
0/3 starsFile:Star empty.svgFile:Star empty.svg {{rating|0|3}}
3.5/6 starsFile:Star empty.svgFile:Star empty.svg {{rating|3.5|6}}
8/8 stars {{rating|8|8}}
5/10 starsFile:Star empty.svgFile:Star empty.svgFile:Star empty.svgFile:Star empty.svgFile:Star empty.svg {{rating|5|10}}
3 stars {{rating|3}}

Extra parameters

These parameters are optional, and can change the appearance of the rating or its tooltip.

  • |score= is used to change the alt text when mousing over the rating, in the case where "x/x" is not accurate or more information can be added.
  • |full=, |half= and |empty= are used to change the images from the default stars to images you specify for each case. You don't have to fill out parameters for images you won't use, but omitting ones you will use results in stars being used for the unspecified portion (e.g. {{rating|2|5|full=Disc Plain red.png}} makes 2/5 starsFile:Star empty.svgFile:Star empty.svgFile:Star empty.svg). Just the image name should be used without prepending "File:" or "Image:".
    Important: Image files must be public domain only, as they are not linked back to their image description pages.
  • |rating= should be used to name the new rating symbol if you change the images.
  • |rating-plural= accepts non-standard pluralization in the tooltip to be used instead of adding "s" in simple cases. For instance, you could use this to change the default "thumb ups" to "thumbs up".
  • |size= can be used to adjust the width at which the rating symbols display. The template defaults to symbols 11 pixels wide for up to five images and 7 pixels wide for more than five. Use the amount of pixels with "px" appended (i.e. "15px" not simply "15").
Examples
3/5 stars in a 0–5 star scaleFile:Star empty.svgFile:Star empty.svg {{rating|3|5|score=3/5 stars in a 0–5 star scale}}
3/5 starsFile:Star empty.svgFile:Star empty.svg {{rating|3|5|size=15px}}
4/5 medals {{rating|4|5|full=Gold medal icon blank.png|empty=Silver medal icon blank.png|rating=medal}}
3.5/5 marks {{rating|3.5|5|full=U+25CF.png|half=U+25D0.png|empty=U+25CB.png|rating=mark}}
2.5/5 marks {{rating|2.5|5|full=Disc Plain red.png|half=Cercle rouge 100%.png|empty=Plain Disc 20% grey.png|rating=mark}}
2 thumbs up {{rating|2|full=Symbol thumbs up.png|rating=thumb up|rating-plural=thumbs up}}
2 thumbs up, but 4 thumbs down, giving this a rating of 2/6 {{rating|2|6|full=Symbol thumbs up.png|empty=Symbol thumbs down.png|rating=thumb up|rating-plural=thumbs up|score=2 thumbs up, but 4 thumbs down, giving this a rating of 2/6}}