Difference between revisions of "Template:GetPropertyValues"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
(Created page with "<noinclude> This template is used to return all the values of a given object's property. '''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but me...")
 
 
(11 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
'''Parameters:'''
 
'''Parameters:'''
 
* <code><nowiki>|object=</nowiki></code> - the fullpagename of the modification.
 
* <code><nowiki>|object=</nowiki></code> - the fullpagename of the modification.
* <code><nowiki>|property=</nowiki></code> - if set, then the author's names will be links to the respective author pages.
+
* <code><nowiki>|property=</nowiki></code> - the property to return.
 +
* <code><nowiki>|intro=</nowiki></code> - initial text that precedes the output, if at least some results exist.
 +
* <code><nowiki>|outro=</nowiki></code> - text that is appended to the output, if at least some results exist.
 +
* <code><nowiki>|intro one=</nowiki></code> - initial text that precedes the output, if exactly one result exist. If not given, <code><nowiki>|intro=</nowiki></code> will be used.
 +
* <code><nowiki>|outro one=</nowiki></code> - text that is appended to the output, if exactly one result exist. If not given, <code><nowiki>|outro=</nowiki></code> will be used.
 +
* <code><nowiki>|default=</nowiki></code> - if, for any reason, the query returns no results, this will be printed instead.
 +
* <code><nowiki>|link=</nowiki></code> - determines whether the values are to be printed as links to the respective pages (where available); possible values are ''none'', ''subject'', ''all''. If not given ''all'' is the default.
 +
* <code><nowiki>|pretty=</nowiki></code> - if non empty, a ''pretty'' list is produced where the last two elements are chained with an ''and'' (or the local languages equivalent).
  
</noinclude><includeonly>{{#arraydefine: values
+
</noinclude><includeonly><!--
  | {{#ask: [[{{{object|}}}]] |mainlabel=- |headers=hide |link=none |?{{{property|}}} |limit=10000 }}
+
-->{{#arraydefine: values<!--
  | , | print=list, unique
+
  -->|{{#ask: [[{{{object|}}}]]<!--
}}</includeonly>
+
  -->|mainlabel=-<!--
 +
  -->|headers=hide<!--
 +
  -->|link={{{link|}}}<!--
 +
  -->|?{{{property|}}}<!--
 +
  -->|limit=10000<!--
 +
  -->}}<!--
 +
  -->| , |unique<!--
 +
-->}}<!--
 +
--><!--
 +
--><!--
 +
-->{{#switch: {{#arraysize: values}}<!--
 +
-->|0={{{default|}}}<!--
 +
-->|1={{#if: {{{intro one|}}}|{{{intro one|}}}|{{{intro|}}} }}<!--
 +
    -->{{#arrayprint: values||@@@@|@@@@|print=pretty}}<!--
 +
    -->{{#if: {{{outro one|}}}|{{{outro one|}}}|{{{outro|}}} }}<!--
 +
-->|{{{intro|}}}<!--
 +
  -->{{#if: {{{pretty|}}}<!--
 +
  -->|{{#arrayprint: values||@@@@|@@@@|print=pretty}}<!--
 +
  -->|{{#arrayprint: values|,&#32;|@@@@|@@@@}}<!--
 +
  -->}}<!--
 +
  -->{{{outro|}}}<!--
 +
-->}}<!--
 +
--><!--
 +
--></includeonly>

Latest revision as of 01:35, 21 May 2017

This template is used to return all the values of a given object's property.

NOTE: As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.

Parameters:

  • |object= - the fullpagename of the modification.
  • |property= - the property to return.
  • |intro= - initial text that precedes the output, if at least some results exist.
  • |outro= - text that is appended to the output, if at least some results exist.
  • |intro one= - initial text that precedes the output, if exactly one result exist. If not given, |intro= will be used.
  • |outro one= - text that is appended to the output, if exactly one result exist. If not given, |outro= will be used.
  • |default= - if, for any reason, the query returns no results, this will be printed instead.
  • |link= - determines whether the values are to be printed as links to the respective pages (where available); possible values are none, subject, all. If not given all is the default.
  • |pretty= - if non empty, a pretty list is produced where the last two elements are chained with an and (or the local languages equivalent).