Difference between revisions of "Template:DisplayRatings"

From Wikispooks
Jump to navigation Jump to search
Line 3: Line 3:
 
''If you wish to display a list of ratings on your userpage, you should use [[Template:Ratings]].''</noinclude><includeonly>{{#switch: {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}
 
''If you wish to display a list of ratings on your userpage, you should use [[Template:Ratings]].''</noinclude><includeonly>{{#switch: {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}
 
  | 0 =
 
  | 0 =
  | 1
+
  | 1 =
  | 2
+
  | 2 <!-- 2 or more, display average rating -->
  | #default = '''Rating''': {{#expr: {{#ask:[[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]| ?Has value| format=average}} round 1}} from {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}} review(2).
+
  | #default = '''Average Rating''': [[Has averageRating::{{FULLPAGENAME}}]] - [[image:[[Has averageRating::{{FULLPAGENAME}}]]star.png]] from {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}} reviews.
}}{{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]
+
{{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]
 
|?-Has subobject
 
|?-Has subobject
 
|?Has value
 
|?Has value

Revision as of 03:52, 10 April 2016

This is intended for use on pages in the document: namespace (or later, the main namespace). It makes a list of ratings of that page.
It currently has no parameters, but this may change.
If you wish to display a list of ratings on your userpage, you should use Template:Ratings.