Difference between revisions of "Template:PrintTopicAcceptedTheoriesList"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 5: Line 5:
  
 
'''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.
Line 13: Line 13:
 
* <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>|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
+
--><!-- check the grouping flag
-->{{#arraydefine: varAccTheories<!--
+
-->{{#ifeq: {{{groupbycommunity|no}}}|yes<!--
  -->|{{#ask:<!--
+
  -->|<!-- yes
    -->[[SubObjectCategory::Acceptance Record]]<!--
+
  --><!-- get the communities first
    -->[[Topic::{{{topic|}}}]]<!--
+
  -->{{#arraydefine: varAccCommunities<!--
    -->[[Still Accepted::true]]<!--  
+
    -->|{{#ask:<!--
    -->|?Theory<!--
+
      -->[[SubObjectCategory::Acceptance Record]]<!--
    -->|mainlabel=-<!--
+
      -->[[Topic::{{{topic|}}}]]<!--
    -->|headers=hide<!--
+
      -->[[Still Accepted::true]]<!--  
    -->|link=none<!--
+
      -->|?Community<!--
    -->|limit=10000<!--
+
      -->|mainlabel=-<!--
  -->}}<!--
+
      -->|headers=hide<!--
  -->| , |unique<!--
+
      -->|link=none<!--
-->}}<!-- arraydefine
+
      -->|limit=10000<!--
--><!--
+
    -->}}<!--
--><!-- remove duplicates
+
    -->| , |unique<!--
-->{{#arrayunique: varAccTheories}}<!--
+
  -->}}<!-- arraydefine
--><!--
+
  --><!--
-->{{#switch: {{#arraysize: varAccTheories}}<!--
+
  --><!-- remove duplicates
  -->|0={{{default|}}}<!--
+
  -->{{#arrayunique: varAccCommunities}}<!--
  -->|{{{intro|}}}<!--
+
  --><!--
  -->{{#arrayprint: varAccTheories<!--
+
  -->{{#switch: {{#arraysize: varAccCommunities}}<!--
    -->||@@@@<!--
+
    -->|0={{{default|}}}<!--
    -->|{{#ifeq: {{{linebreak|}}}|yes|<nowiki/>
+
    -->|{{{intro|}}}<!--
 +
    -->{{#arrayprint: varAccCommunities<!--
 +
      -->||@@@@<!--
 +
      -->|{{#ifeq: {{{linebreak|}}}|yes|<nowiki/>
 
|&#32;}}{{#ifeq: {{{bullets|}}}|yes|*<nowiki> </nowiki>|}}<!--
 
|&#32;}}{{#ifeq: {{{bullets|}}}|yes|*<nowiki> </nowiki>|}}<!--
     -->{{#ifeq: {{{details|}}}|yes<!--
+
      -->{{PrintCommunityTopicCurrentTheoriesList|community=@@@@|topic={{{topic|}}}|communitiesfirst={{{communitiesfirst|no}}}|link=all|linktheory=yes}}<!--
    -->|{{PrintTheoryCurrentlyAcceptedInCommunities|theory=@@@@|communitiesfirst={{{communitiesfirst|no}}}|link=all|linktheory=yes}}<!--  
+
    -->}}<!--arrayprint
      --><nowiki/> {{#show: @@@@|?Formulation Text|link=none}}<!--  
+
    -->{{{outro|}}}<!--
      --><!--  
+
  -->}}<!-- switch
      --><!-- add image if exists  Formulation File  
+
  --><!--
      -->{{#if: {{#show: @@@@|?Formulation File|link=none}}|<nowiki/>
+
  --><!-- in this version the theory details are ignored
 +
  --><!--
 +
  -->|<!-- no
 +
  --><!-- get the theories first
 +
  -->{{#arraydefine: varAccTheories<!--
 +
    -->|{{#ask:<!--
 +
      -->[[SubObjectCategory::Acceptance Record]]<!--
 +
      -->[[Topic::{{{topic|}}}]]<!--
 +
      -->[[Still Accepted::true]]<!--
 +
      -->|?Theory<!--
 +
      -->|mainlabel=-<!--
 +
      -->|headers=hide<!--
 +
      -->|link=none<!--
 +
      -->|limit=10000<!--
 +
    -->}}<!--
 +
    -->| , |unique<!--
 +
  -->}}<!-- arraydefine
 +
  --><!--
 +
  --><!-- remove duplicates
 +
  -->{{#arrayunique: varAccTheories}}<!--
 +
  --><!--
 +
  -->{{#switch: {{#arraysize: varAccTheories}}<!--
 +
    -->|0={{{default|}}}<!--
 +
     -->|{{{intro|}}}<!--
 +
    -->{{#arrayprint: varAccTheories<!--
 +
      -->||@@@@<!--
 +
      -->|{{#ifeq: {{{linebreak|}}}|yes|<nowiki/>
 +
|&#32;}}{{#ifeq: {{{bullets|}}}|yes|*<nowiki> </nowiki>|}}<!--
 +
      -->{{#ifeq: {{{details|}}}|yes<!--
 +
      -->|{{PrintTheoryCurrentlyAcceptedInCommunities|theory=@@@@|communitiesfirst={{{communitiesfirst|no}}}|link=all|linktheory=yes}}<!--  
 +
        --><nowiki/> {{#show: @@@@|?Formulation Text|link=none}}<!--  
 +
        --><!--  
 +
        --><!-- add image if exists  Formulation File  
 +
        -->{{#if: {{#show: @@@@|?Formulation File|link=none}}|<nowiki/>
  
 
{{PrintDiagramFile|diagram file={{#show: @@@@|?Formulation File|link=none}}|}}
 
{{PrintDiagramFile|diagram file={{#show: @@@@|?Formulation File|link=none}}|}}
 
<nowiki/>
 
<nowiki/>
 
<!--  
 
<!--  
      -->}}<!-- if diagram  
+
        -->}}<!-- if diagram  
    -->|{{PrintTheoryCurrentlyAcceptedInCommunities|theory=@@@@|communitiesfirst={{{communitiesfirst|no}}}|link=all|linktheory=yes}}<!--  
+
      -->|{{PrintTheoryCurrentlyAcceptedInCommunities|theory=@@@@|communitiesfirst={{{communitiesfirst|no}}}|link=all|linktheory=yes}}<!--  
    -->}}<!-- if details
+
      -->}}<!-- if details
  -->}}<!--arrayprint  
+
    -->}}<!--arrayprint  
  -->{{{outro|}}}<!--
+
    -->{{{outro|}}}<!--
  -->}}<!-- switch
+
  -->}}<!-- switch
 +
  --><!--
 +
  -->}}<!-- ifeq
 
--><!--
 
--><!--
 
-->}}<!-- if  
 
-->}}<!-- if  
 
--></includeonly>
 
--></includeonly>

Revision as of 01:04, 28 September 2016

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.

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.
  • |details= - if yes, then details of the theory such as its formulation and diagram are added to each record.
  • |bullets= - if yes, a bullet-list will be produced.
  • |linebreak= - if yes, each theory's entry will start from a new line; if no (default), a mere space will be added between sentences.
  • |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.).