Difference between revisions of "Template:PrintTopicRelatedTopics"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 6: Line 6:
 
'''Parameters:'''
 
'''Parameters:'''
 
* <code><nowiki>|topic=</nowiki></code> - the page for which related topics are to be printed.
 
* <code><nowiki>|topic=</nowiki></code> - the page for which related topics are to be printed.
 +
* <code><nowiki>|includeinverselyrelatedtopics=</nowiki></code> - if yes, the topics to which this topic is itself related will also be included in the list.
 +
* <code><nowiki>|includeparenttopic=</nowiki></code> - if yes, the parent topic is also included in the list.
 +
* <code><nowiki>|includesubtopics=</nowiki></code> - if yes, the subtopics of the topic are also included. 
 
* <code><nowiki>|intro=</nowiki></code> - initial text that precedes the output, if at least some results exist.
 
* <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>|outro=</nowiki></code> - text that is appended to the output, if at least some results exist.
 
* <code><nowiki>|default=</nowiki></code> - if, for any reason, the query returns no results, this will be printed instead.
 
* <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 printer as links to the respective pages (where available); possible values are ''none'', ''subject'', ''all''. If not given ''all'' is the default.
 
* <code><nowiki>|link=</nowiki></code> - determines whether the values are to be printer 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 non empty, a bullet-list will be produced.
+
* <code><nowiki>|link=</nowiki></code> - determines whether the values are to be printer as links to the respective pages (where available); possible values are ''none'', ''subject'', ''all''. If not given ''all'' is the default.
* <code><nowiki>|includeinverselyrelatedtopics=</nowiki></code> - if yes, the topics to which this topic is itself related will also be included in the list.  
+
* <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).
* <code><nowiki>|includeparenttopic=</nowiki></code> - if yes, the parent topic is also included in the list.  
 
* <code><nowiki>|includesubtopics=</nowiki></code> - if yes, the subtopics of the topic are also included.
 
  
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
Line 74: Line 75:
 
-->{{#arraysort: values|asc}}<!--
 
-->{{#arraysort: values|asc}}<!--
 
--><!--
 
--><!--
 +
--><!-- print
 
-->{{#switch: {{#arraysize: values}}<!--
 
-->{{#switch: {{#arraysize: values}}<!--
 
  -->|0={{{default|}}}<!--
 
  -->|0={{{default|}}}<!--
 
  -->|{{{intro|}}}<!--
 
  -->|{{{intro|}}}<!--
   -->{{#arrayprint: values||@@@@|{{#if: {{{bullets|}}}|* |}}@@@@<br/>}}<!--
+
   -->{{#if: {{{pretty|}}}<!--
 +
  -->|{{#arrayprint: values||@@@@|@@@@|print=pretty}}<!--
 +
  -->|{{#arrayprint: values|,&#32;|@@@@|@@@@}}<!--
 +
  -->}}<!--
 
   -->{{{outro|}}}<!--
 
   -->{{{outro|}}}<!--
 
-->}}<!--
 
-->}}<!--
 
--><!--
 
--><!--
 
--></includeonly>
 
--></includeonly>

Revision as of 13:04, 30 August 2016

This template is used to print an array of topics related to the topic. By default only the topics that have been explicitly indicated as being related to the topic in question on the topic's page are included in the output. To add other topics (such as the parent topic, the subtopics, and the topics to which this topic itself is related to) use the |include...= flags.

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

Parameters:

  • |topic= - the page for which related topics are to be printed.
  • |includeinverselyrelatedtopics= - if yes, the topics to which this topic is itself related will also be included in the list.
  • |includeparenttopic= - if yes, the parent topic is also included in the list.
  • |includesubtopics= - if yes, the subtopics of the topic are also included.
  • |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 printer as links to the respective pages (where available); possible values are none, subject, all. If not given all is the default.
  • |link= - determines whether the values are to be printer 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).