Difference between revisions of "Template:PrintModificationQuestionsAnswered"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
 
(24 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
Use this template to display the questions/problems that a modification attempts to solve.
 
Use this template to display the questions/problems that a modification attempts to solve.
  
Parameters:
+
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
* <code><nowiki>|questions=</nowiki></code> - a comma separated list of questions; each element in this list should be a Topic page.
 
</noinclude>
 
<includeonly>{{#if:{{{questions|}}}|This modification attempts to answer the following question(s):
 
  
{{#replace:{{{questions|}}}|,|<br><br>}}
+
'''Parameters:'''
 +
* <code><nowiki>|modification=</nowiki></code> - the modification that attempts to answer questions.
 +
* <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>|default=</nowiki></code> - if, for any reason, the query returns no results, this will be printed instead.
  
{{#arraymap:{{#replace:{{{questions|}}}|,|<br><br>}}|<br><br>|varTopic| * [[Answers question::varTopic]]: {{#show:varTopic|?Question}} }}  
+
</noinclude><includeonly><!--
 
+
--><!-- add the questions
 
+
-->{{#arraydefine: questionsArray|{{GetPropertyValues|object={{{modification|}}}|property=Answers Question|link=none}} }}<!--
}}</includeonly>
+
--><!--
 +
-->{{#switch: {{#arraysize: questionsArray}} <!--
 +
-->|0={{{default|}}}<!--
 +
-->|{{{intro|}}}<!--
 +
  -->{{#arrayprint:questionsArray||@@@@|{{#if:@@@@|<nowiki/>
 +
* [[@@@@]]: {{#show:@@@@|?Question}}|}}<!--
 +
  -->}}<!-- print
 +
  -->{{{outro|}}}<!--
 +
-->}}<!--
 +
--></includeonly>

Latest revision as of 23:01, 30 August 2016

Use this template to display the questions/problems that a modification attempts to solve.

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

Parameters:

  • |modification= - the modification that attempts to answer questions.
  • |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.