Difference between revisions of "Template:PrintRelatedTopics"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
(Created page with "<noinclude> This template is used to properly format an array of related topics. Parameters: * <code><nowiki>|topics=</nowiki></code> - a comma separated list of the topics....")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template is used to properly format an array of related topics.
+
This template is used to print an array of topics related to the page. This works for any page type that has property "Has Related Topic".  
  
Parameters:
+
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
* <code><nowiki>|topics=</nowiki></code> - a comma separated list of the topics.
 
* <code><nowiki>|intro=</nowiki></code> - the text that should precede the list, e.g. "Here are the major topics tackled by this author:".
 
  
</noinclude>
+
'''Parameters:'''
<includeonly>{{#if:{{{topics|}}} | {{{intro|}}}
+
* <code><nowiki>|object=</nowiki></code> - the page for which related topics are to be printed.
{{#arraydefine:topicsArray|{{{topics|}}} }}
+
* <code><nowiki>|intro=</nowiki></code> - initial text that precedes the output, if at least some results exist.
{{#arrayprint:topicsArray||@@@@|{{#if:@@@@|[[Has related topic::@@@@]]
+
* <code><nowiki>|outro=</nowiki></code> - text that is appended to the output, if at least some results exist.
<nowiki/> <br/>
+
* <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>|bullets=</nowiki></code> - if ''yes'', a bullet-list will be produced.
}}</includeonly>
+
 
 +
</noinclude><includeonly>{{GetPropertyValuesList|object={{{object|}}}|property=Has Related Topic|intro={{{intro|}}}|outro={{{outro|}}}|default={{{default|}}}|link={{{link|}}}|bullets={{{bullets|}}}|}}</includeonly>

Latest revision as of 15:03, 30 August 2016

This template is used to print an array of topics related to the page. This works for any page type that has property "Has Related Topic".

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

Parameters:

  • |object= - the page for which related topics are to be printed.
  • |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.
  • |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.
  • |bullets= - if yes, a bullet-list will be produced.