Difference between revisions of "Template:MyRatings"

From Wikispooks
Jump to navigation Jump to search
Line 1: Line 1:
 
<noinclude>[[category:Rating Templates]]'''This is intended for use on pages in the {{NS|user}}. It makes a list of all that users' ratings.'''<br/>
 
<noinclude>[[category:Rating Templates]]'''This is intended for use on pages in the {{NS|user}}. It makes a list of all that users' ratings.'''<br/>
 
If the user has no ratings, it draws a thin stripey black line. It calls [[Template:MyRatings/Output]] to format output.<br/>
 
If the user has no ratings, it draws a thin stripey black line. It calls [[Template:MyRatings/Output]] to format output.<br/>
It currently has no parameters, but this may change.<br/>
+
It currently has one optional parameter, the sort key:<br/>
 +
<nowiki>{{</nowiki>{{PAGENAME}}
 +
|sort=Has value (defaults to 'Has publicationDate')
 +
|order=ascending (defaults to 'random')
 +
<nowiki>}}</nowiki>
 +
}}
 
''Targets of ratings (i.e. [[SMWObject]]s) should use [[Template:DisplayRatings]].''<br/>
 
''Targets of ratings (i.e. [[SMWObject]]s) should use [[Template:DisplayRatings]].''<br/>
 
<br/>
 
<br/>
 
'''Example:'''<br/>
 
'''Example:'''<br/>
 
{{t|<nowiki>==Ratings==</nowiki>}}<br/>
 
{{t|<nowiki>==Ratings==</nowiki>}}<br/>
{{t|<nowiki>{{MyRatings}}</nowiki> }}
+
{{t|<nowiki>{{MyRatings|sort=Has value}}</nowiki> }}
 
</noinclude><includeonly><div style="border-color:black; border-width:3px; border-style:groove;">{{#ask: [[Constitutes::Rating]][[-Has subobject::{{FULLPAGENAME}}]]
 
</noinclude><includeonly><div style="border-color:black; border-width:3px; border-style:groove;">{{#ask: [[Constitutes::Rating]][[-Has subobject::{{FULLPAGENAME}}]]
 
|?Has target#NOWIKI
 
|?Has target#NOWIKI
Line 14: Line 19:
 
|?Description2
 
|?Description2
 
|format=template
 
|format=template
|sort=Has publicationDate
+
|order={{{order|random}}}
 +
|sort={{{sort|Has publicationDate}}}
 
|template=MyRatings/Output
 
|template=MyRatings/Output
 
}}</div></includeonly>
 
}}</div></includeonly>

Revision as of 10:16, 26 August 2016

This is intended for use on pages in the user: namespace. It makes a list of all that users' ratings.
If the user has no ratings, it draws a thin stripey black line. It calls Template:MyRatings/Output to format output.
It currently has one optional parameter, the sort key:
{{MyRatings |sort=Has value (defaults to 'Has publicationDate') |order=ascending (defaults to 'random') }} }} Targets of ratings (i.e. SMWObjects) should use Template:DisplayRatings.

Example:
==Ratings==
{{MyRatings|sort=Has value}}