Difference between revisions of "Template:MyRatings"

From Wikispooks
Jump to navigation Jump to search
(line)
(Fix??)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>'''When placed on a user's page, this 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 there are no ratings on that page, it draws a thin stripey black line.<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/><br/>
+
It currently has one optional parameter, the sort key:<br/>
 +
<nowiki>{{</nowiki>{{PAGENAME}}<br/>
 +
|sort=Has publicationDate (defaults to 'Has value')<br/>
 +
|order=random (defaults to 'descending')<br/>
 +
<nowiki>}}</nowiki><br/>
 +
''Targets of ratings (i.e. [[SMWObject]]s) should use [[Template:DisplayRatings]].''<br/>
 +
<br/>
 
'''Example:'''<br/>
 
'''Example:'''<br/>
 
{{t|<nowiki>==Ratings==</nowiki>}}<br/>
 
{{t|<nowiki>==Ratings==</nowiki>}}<br/>
{{t|<nowiki>{{ratings}}</nowiki> }}
+
{{t|<nowiki>{{MyRatings|sort=Has publicationDate}}</nowiki> }}
</noinclude><includeonly><div style="border-color:black; border-width:3px; border-style:groove;">{{#ask: [[Constitutes::Rating]][[-Has subobject::{{PAGENAME}}]]
+
</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
 
|?Has value
 
|?Has value
 
|?Has publicationDate
 
|?Has publicationDate
 
|?Has summary
 
|?Has summary
|?Description2
+
|?Description
|format=template
+
|order={{#if: {{{order|}}}|{{{order|}}}|descending}}}
|sort=Has publicationDate
+
|sort={{#if: {{{sort|}}}|{{{sort|}}}|Has value}}}
|template=Ratings/Output
+
|template=MyRatings/Output
 
}}</div></includeonly>
 
}}</div></includeonly>

Latest revision as of 17:25, 4 July 2019

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 publicationDate (defaults to 'Has value')
|order=random (defaults to 'descending')
}}
Targets of ratings (i.e. SMWObjects) should use Template:DisplayRatings.

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