Difference between revisions of "Template:PrintRelatedTopics"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
m (HakobBarseghyan moved page Template:RelatedTopics to Template:PrintRelatedTopics without leaving a redirect)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template is used to print 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".  
  
 
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
 
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
  
 
'''Parameters:'''
 
'''Parameters:'''
* <code><nowiki>|topics=</nowiki></code> - a comma separated list of the topics.
+
* <code><nowiki>|object=</nowiki></code> - the page for which related topics are to be printed.
 
* <code><nowiki>|intro=</nowiki></code> - the text that should precede the list, e.g. "Here are the major topics tackled by this author:".
 
* <code><nowiki>|intro=</nowiki></code> - the text that should precede the list, e.g. "Here are the major topics tackled by this author:".
 +
* <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>|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><!--
+
</noinclude><includeonly>{{GetPropertyValues|object={{{object|}}}|property=Has Related Topics|intro={{{intro|}}}|link={{{link|}}}|pretty={{{pretty|}}}|}}</includeonly>
-->{{#if:{{{topics|}}} |<!--
 
--><!-- add intro
 
-->{{{intro|}}}<!--
 
--><!-- add topics
 
-->{{#arraydefine:topicsArray|{{{topics|}}} }}<!--
 
-->{{#arrayunique:topicsArray}}<!--
 
-->{{#arrayprint:topicsArray||@@@@|[[@@@@]]
 
<nowiki/><br/><!--
 
-->}}<!--
 
-->}}</includeonly>
 

Revision as of 01:08, 19 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= - the text that should precede the list, e.g. "Here are the major topics tackled by this author:".
  • |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).