Difference between revisions of "Template:PrintTopicAcceptedTheoriesList"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
 
(49 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template is used to print a list of accepted theories on this topic. It looks for the accepted theories on the topic and then indicates which communities it is currently accepted by.
+
This template is used to print a list of accepted theories on this topic. It displays the theories accepted on a given topic by sorting them according to their topic's sorting order. To print the details of the accepted theories, use [[Template:PrintTopicAcceptedTheoriesDetails]].
 +
 
 +
The template prints a short statement of which theories are accepted in which community. This can be done in two options depending on the value of <code><nowiki>groupbycommunity</nowiki></code>:
 +
 
 +
''Option 1'': (if <code><nowiki>groupbycommunity=yes</nowiki></code>)
 +
* Community A: Theory 1, Theory 2, Theory 3
 +
* Community B: Theory 2, Theory 3, Theory 4
 +
* Community C: Theory 1, Theory 3, Theory 5
 +
 
 +
''Option 2'': (if <code><nowiki>groupbycommunity=no</nowiki></code> or empty)
 +
* Theory 1: Community A, Community C
 +
* Theory 2: Community A, Community B
 +
* Theory 3: Community A, Community B, Community C
 +
* Theory 4: Community B
 +
* Theory 5: Community C
 +
 
 +
Formulation texts can also be printed if <code><nowiki>formulationtext=yes</nowiki></code>.
 +
 
  
 
'''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>|topic=</nowiki></code> - the theory.
+
* <code><nowiki>|topic=</nowiki></code> - the topic.
 
* <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>|details=</nowiki></code> - if ''yes'', then details of the theory such as its formulation and diagram are added to each record.
+
* <code><nowiki>|formulationtext=</nowiki></code> - if ''yes'', the formulation of the theory will be added. Otherwise (default), the formulation text won't be printed.
* <code><nowiki>|bullets=</nowiki></code> - if ''yes'', a bullet-list will be produced.
 
* <code><nowiki>|linebreak=</nowiki></code> - if ''yes'', each theory's entry will start from a new line; if ''no'' (default), a mere space will be added between sentences.
 
 
* <code><nowiki>|communitiesfirst=</nowiki></code> - if ''yes'', the communities will be mentioned first in the sentence. If ''no'' (default) the name of the theory will appear first.
 
* <code><nowiki>|communitiesfirst=</nowiki></code> - if ''yes'', the communities will be mentioned first in the sentence. If ''no'' (default) the name of the theory will appear first.
 +
* <code><nowiki>|groupbycommunity=</nowiki></code> - if ''yes'', the result will be grouped by community (e.g. Theories A, B, C are accepted by community X. Theories A, D, E are accepted by community Y.) If ''no'' (default) the result will be grouped by theory (e.g. Theory A is accepted in communities X and Y.).
  
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
-->{{#if: {{{topic|}}} |<!--
+
-->{{#if: {{{topic|}}}<!--
--><!-- get the theories first
+
-->|<!--  
-->{{#arraydefine: varAccTheories<!--
+
  -->|{{#ask:<!--
+
  --><!-- Get the default text
    -->[[SubObjectCategory::Acceptance Record]]<!--
+
  --><!--
    -->[[Topic::{{{topic|}}}]]<!--
+
  -->{{#switch: {{#show: {{{topic|}}}|?Topic Type|link=none}}<!--
    -->[[Still Accepted::true]]<!--  
+
  -->|<!--
    -->|?Theory<!--
+
    -->Definitional={{#vardefine: varDefault|At the moment, the term has no accepted definition in}}<!--
    -->|mainlabel=-<!--
+
  -->|<!--
    -->|headers=hide<!--
+
    -->{{#vardefine: varDefault|At the moment, the question has no accepted answer in}}<!--
    -->|link=none<!--
+
  -->}}<!-- switch
    -->|limit=10000<!--
+
  --><!--
   -->}}<!--
+
 
   -->| , |unique<!--
+
  --><!-- Get the list of all answers
-->}}<!-- arraydefine
+
  --><!--
--><!--
+
  -->{{#arraydefine: varAnswers<!--
--><!-- remove duplicates
+
  -->|{{#ask:<!--
-->{{#arrayunique: varAccTheories}}<!--
+
    -->[[SubObjectCategory::Current Answer]]<!--
--><!--
+
    -->[[Topic::{{{topic|}}}]]<!--
-->{{#switch: {{#arraysize: varAccTheories}}<!--
+
    -->[[Answer Type::Complete||Inherited||Partial]]<!--  
  -->|0={{{default|}}}<!--
+
    -->|?Theory<!--
  -->|{{{intro|}}}<!--
+
    -->|mainlabel=-<!--
  -->{{#arrayprint: varAccTheories<!--
+
    -->|headers=hide<!--
    -->||@@@@<!--
+
    -->|sort=Answer Type, Sorting Order<!--
    -->|{{#ifeq: {{{linebreak|}}}|yes|<nowiki/>
+
    -->|order=asc, asc<!--
|&#32;}}{{#ifeq: {{{bullets|}}}|yes|*<nowiki> </nowiki>|}}<!--
+
    -->|link=none<!--
     -->{{#ifeq: {{{details|}}}|yes<!--
+
    -->|limit=10000<!--
    -->|{{PrintTheoryCurrentlyAcceptedInCommunities|theory=@@@@|communitiesfirst={{{communitiesfirst|no}}}|link=all|linktheory=yes}}<!--  
+
    -->}}<!--
       --><nowiki/> {{#show: @@@@|?Formulation Text|link=none}}<!--  
+
   -->| , |unique<!--
      --><!--  
+
  -->}}<!-- arraydefine
      --><!-- add image if exists  Formulation File
+
  --><!--
      -->{{#if: {{#show: @@@@|?Formulation File|link=none}}|<nowiki/>
+
   --><!-- remove duplicates
 +
  -->{{#arrayunique: varAnswers}}<!--
 +
 
 +
  --><!--
 +
  --><!-- Check the grouping flag
 +
  --><!--
 +
  -->{{#ifeq: {{{groupbycommunity|no}}}|yes<!--
 +
 
 +
  -->|<!-- Yes: Group BY Community
 +
    --><!--
 +
    -->{{#arraydefine: varAccCommunities<!--
 +
    -->|{{#ask:<!--
 +
      -->[[SubObjectCategory::Current Answer]]<!--
 +
      -->[[Topic::{{{topic|}}}]]<!--
 +
      -->|?Community<!--
 +
      -->|mainlabel=-<!--
 +
      -->|headers=hide<!--
 +
      -->|link=none<!--
 +
      -->|limit=10000<!--
 +
      -->}}<!--
 +
    -->| , |unique<!--
 +
    -->}}<!-- arraydefine
 +
    --><!--
 +
    --><!-- remove duplicates
 +
    -->{{#arrayunique: varAccCommunities}}<!--
 +
    --><!--
 +
    -->{{#switch: {{#arraysize: varAccCommunities}}<!--
 +
    -->|0={{{default|}}}<!--
 +
    -->|{{{intro|}}}<!--
 +
      -->{{#arrayprint: varAccCommunities||varCommunity<!--
 +
      -->|<!--
 +
        -->{{PrintCommunityTopicCurrentTheories<!--
 +
        -->|community=varCommunity<!--
 +
        -->|topic={{{topic|}}}<!--
 +
        -->|default={{#var: varDefault}} [[varCommunity|{{PAGENAME: varCommunity}}]].<!--
 +
        -->|communityfirst={{{communitiesfirst|no}}}<!--
 +
        -->|formulationtext={{{formulationtext|no}}}<!--
 +
        -->|link=yes<!--
 +
        -->|linktheory=yes<!--
 +
        -->}}&#32;<!--
 +
 
 +
      -->}}<!--arrayprint
 +
 +
    -->{{{outro|}}}<!--
 +
    -->}}<!-- switch
 +
    --><!--
 +
 
 +
 
 +
  -->|<!-- No: Group By Theory
 +
    --><!--
 +
    --><!--
 +
     -->{{#switch: {{#arraysize: varAccTheories}}<!--
 +
    -->|0={{{default|}}}<!--
 +
    -->|{{{intro|}}}<!--
 +
      -->{{#arrayprint: varAccTheories||varTheory<!--
 +
      -->|<!--
 +
 
 +
        -->{{PrintTheoryCurrentlyAcceptedInCommunities<!--
 +
        -->|theory=varTheory<!--
 +
        -->|communitiesfirst={{{communitiesfirst|no}}}<!--
 +
        -->|link=yes<!--
 +
        -->|linktheory=yes<!--
 +
        -->}}&#32;<!--  
 +
 
 +
       -->}}<!--arrayprint
 +
 
 +
      -->{{{outro|}}}<!--
 +
    -->}}<!-- switch
 +
  --><!--
 +
 
 +
 
 +
  -->}}<!-- ifeq grouping flag
  
{{PrintDiagramFile|diagram file={{#show: @@@@|?Formulation File|link=none}}|}}
 
<nowiki/>
 
<!--
 
      -->}}<!-- if diagram
 
    -->|{{PrintTheoryCurrentlyAcceptedInCommunities|theory=@@@@|communitiesfirst={{{communitiesfirst|no}}}|link=all|linktheory=yes}}<!--
 
    -->}}<!-- if details
 
  -->}}<!--arrayprint
 
  -->{{{outro|}}}<!--
 
-->}}<!-- switch
 
--><!--
 
 
-->}}<!-- if  
 
-->}}<!-- if  
 
--></includeonly>
 
--></includeonly>

Latest revision as of 23:12, 26 February 2023

This template is used to print a list of accepted theories on this topic. It displays the theories accepted on a given topic by sorting them according to their topic's sorting order. To print the details of the accepted theories, use Template:PrintTopicAcceptedTheoriesDetails.

The template prints a short statement of which theories are accepted in which community. This can be done in two options depending on the value of groupbycommunity:

Option 1: (if groupbycommunity=yes)

  • Community A: Theory 1, Theory 2, Theory 3
  • Community B: Theory 2, Theory 3, Theory 4
  • Community C: Theory 1, Theory 3, Theory 5

Option 2: (if groupbycommunity=no or empty)

  • Theory 1: Community A, Community C
  • Theory 2: Community A, Community B
  • Theory 3: Community A, Community B, Community C
  • Theory 4: Community B
  • Theory 5: Community C

Formulation texts can also be printed if formulationtext=yes.


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


Parameters:

  • |topic= - the topic.
  • |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.
  • |formulationtext= - if yes, the formulation of the theory will be added. Otherwise (default), the formulation text won't be printed.
  • |communitiesfirst= - if yes, the communities will be mentioned first in the sentence. If no (default) the name of the theory will appear first.
  • |groupbycommunity= - if yes, the result will be grouped by community (e.g. Theories A, B, C are accepted by community X. Theories A, D, E are accepted by community Y.) If no (default) the result will be grouped by theory (e.g. Theory A is accepted in communities X and Y.).