Difference between revisions of "Template:PrintCommunityTopicCurrentTheoriesFormulations"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
(Created page with "<noinclude> This template is used to print the formulations of theories accepted by the community on the given topic. It prints the formulations only by grouping them as neede...")
 
Line 9: Line 9:
 
The template will print:
 
The template will print:
 
* “The stances of theory acceptance, theory pursuit, and theory use can be taken towards theories.”
 
* “The stances of theory acceptance, theory pursuit, and theory use can be taken towards theories.”
 +
 +
 +
'''TODO: FIX THIS'''
  
  
Line 30: Line 33:
 
-->{{#arraydefine: varTheories<!--
 
-->{{#arraydefine: varTheories<!--
 
  -->|{{#ask:<!--
 
  -->|{{#ask:<!--
   -->[[SubObjectCategory::Topic Current Answer]]<!--  
+
   -->[[SubObjectCategory::Current Answer]]<!--  
 
   -->[[Community::{{{community|}}}]]<!--  
 
   -->[[Community::{{{community|}}}]]<!--  
 
   -->[[Topic::{{{topic|}}}]]<!--  
 
   -->[[Topic::{{{topic|}}}]]<!--  
 +
  -->[[Answer Type::Complete||Inherited||Partial]]<!--
 
   -->|?Theory<!--
 
   -->|?Theory<!--
 +
  -->|sort=Answer Type, Sorting Order<!--
 +
  -->|order=asc, asc<!--
 
   -->|mainlabel=-<!--
 
   -->|mainlabel=-<!--
 
   -->|headers=hide<!--
 
   -->|headers=hide<!--
Line 62: Line 68:
 
   --><!--
 
   --><!--
 
   -->{{#vardefine: varAcceptedText|{{#ifeq: {{#show: {{{topic|}}}|?Topic Type|link=none}}|Definitional|definition of the term|answer to the question}}|}}<!--
 
   -->{{#vardefine: varAcceptedText|{{#ifeq: {{#show: {{{topic|}}}|?Topic Type|link=none}}|Definitional|definition of the term|answer to the question}}|}}<!--
 +
  -->{{#vardefine: varTheoryPrint|{{#show: {{#arrayindex: varTheories|0}}|?Formulation Text|link=none}}}}<!--
 
   --><!--
 
   --><!--
 
   --><!-- Get the community depending on the link
 
   --><!-- Get the community depending on the link
 
   -->{{#ifeq: {{{link|no}}}|yes<!--
 
   -->{{#ifeq: {{{link|no}}}|yes<!--
 
   -->|<!--
 
   -->|<!--
     -->{{#vardefine: varCommunityPrint|[[{{{community|}}}|{{PAGENAME:{{{community|}}}}}]] }}<!--
+
     -->{{#vardefine: varCommunityPrint|[[{{{community|}}}|{{PAGENAME:{{{community|}}}}}]]|}}<!--
    -->{{#vardefine: varTheoryPrint|"{{#show: {{#arrayindex: varTheories|0}}|?Formulation Text|link=all}}"}}<!--
 
    --><!--
 
 
   -->|<!--
 
   -->|<!--
    --><!-- Links are not needed
+
     -->{{#vardefine: varCommunityPrint|{{PAGENAME:{{{community|}}}}}|}}<!--
    --><!--
 
     -->{{#vardefine: varCommunityPrint|{{PAGENAME:{{{community|}}}}} }}<!--
 
    -->{{#vardefine: varTheoryPrint|"{{#show: {{#arrayindex: varTheories|0}}|?Formulation Text|link=none}}"}}<!--
 
 
     --><!--
 
     --><!--
 
   -->}}<!-- if links
 
   -->}}<!-- if links
Line 79: Line 81:
 
   --><!-- Print
 
   --><!-- Print
 
   --><!--
 
   --><!--
   -->In {{#var: varCommunityPrint}}, the accepted {{#var: varAcceptedText}} is {{#var: varTheoryPrint}}&#32;<!--
+
   --><p>In {{#var: varCommunityPrint}}, the accepted {{#var: varAcceptedText}} is:</p><p>* {{#var: varTheoryPrint}}&#32;</p><!--
 
   --><!--
 
   --><!--
 
   --><!--
 
   --><!--
Line 88: Line 90:
 
   --><!-- Multiple Values
 
   --><!-- Multiple Values
 
   --><!--
 
   --><!--
 +
 
   -->{{{intro|}}}<!--
 
   -->{{{intro|}}}<!--
 
   --><!--
 
   --><!--
 
+
  --><!-- Check what sort of a topic this is and generate the text
   --><!-- Get the community depending on the link
+
   --><!--
 +
  -->{{#vardefine: varAcceptedText|{{#ifeq: {{#show: {{{topic|}}}|?Topic Type|link=none}}|Definitional|definitions of the term|answers to the question}}|}}<!--
 +
 
   --><!--
 
   --><!--
 +
  --><!-- Get the community and the theory depending on the link
 
   -->{{#ifeq: {{{link|no}}}|yes<!--
 
   -->{{#ifeq: {{{link|no}}}|yes<!--
 
   -->|<!--
 
   -->|<!--
 
     -->{{#vardefine: varCommunityPrint|[[{{{community|}}}|{{PAGENAME:{{{community|}}}}}]] }}<!--
 
     -->{{#vardefine: varCommunityPrint|[[{{{community|}}}|{{PAGENAME:{{{community|}}}}}]] }}<!--
 +
    --><!--
 
   -->|<!--
 
   -->|<!--
 
     -->{{#vardefine: varCommunityPrint|{{PAGENAME:{{{community|}}}}} }}<!--
 
     -->{{#vardefine: varCommunityPrint|{{PAGENAME:{{{community|}}}}} }}<!--
 +
    --><!--
 
   -->}}<!-- ifeq links
 
   -->}}<!-- ifeq links
 
   --><!--
 
   --><!--
 
+
   --><!-- Check if communities should be mentioned first or last and print accordingly
   --><!-- Check if the question has a formula for generating text from multiple answers
+
 
 
   --><!--
 
   --><!--
   -->{{#vardefine: varMultipleFormula|{{#show: {{{topic|}}}|?Multiple Answers Text Formula|link=none}} }}<!--
+
   --><p>In {{#var: varCommunityPrint}}, the accepted {{#var:varAcceptedText}} can be summarized as:</p><!--
 
   --><!--
 
   --><!--
  -->{{#if: {{#var: varMultipleFormula}}<!--
 
  
  -->|<!--
+
  -->{{#ask:<!--
    --><!-- Multiple answer formula is given: group the answers by subject and combine them for each subject
+
  -->[[SubObjectCategory::Current Answer]]<!--  
    --><!--
+
  -->[[Community::{{{community|}}}]]<!--  
    -->{{#arraydefine: varSubjects<!--
+
  -->[[Topic::{{{topic|}}}]]<!--  
    -->|{{#ask:<!--
+
  -->[[Answer Type::Complete||Inherited||Partial]]<!--  
      -->[[SubObjectCategory::Topic Current Answer]]<!--  
+
  -->|?Formulation Text<!--
      -->[[Community::{{{community|}}}]]<!--  
+
  -->|mainlabel=-<!--
      -->[[Topic::{{{topic|}}}]]<!--  
+
  -->|headers=hide<!--
      -->|?Theory.Subject<!--
+
  -->|sort=Answer Type, Sorting Order<!--
      -->|headers=hide<!--
+
  -->|order=asc, asc<!--
      -->|mainlabel=-<!--
+
  -->|format=template<!--
      -->|link=none<!--
+
  -->|template=Result-bullet-point<!--
      -->}}<!-- ask
+
   -->|link=none<!--
    -->| , |unique<!--
+
  -->|limit=10000<!--
    -->}}<!-- arraydefine
+
   -->}}<!--
    -->{{#arrayunique: varSubjects}}<!--
 
 
 
    --><!-- Print the prefix depending on the number of subjects found
 
    --><!--
 
    -->{{#switch: {{#arraysize: varSubjects}}<!--
 
    -->|0=<!--
 
      -->{{#vardefine: varAcceptedText|{{#ifeq: {{#show: {{{topic|}}}|?Topic Type|link=none}}|Definitional|definition of the term is missing; ensure that all the questions have assigned subjects.|answer to the question is missing; ensure that all the questions have assigned subjects.}}|}}<!--
 
      --><!--
 
    -->|1=<!--
 
      -->{{#vardefine: varAcceptedText|{{#ifeq: {{#show: {{{topic|}}}|?Topic Type|link=none}}|Definitional|definition of the term is|answer to the question is}}|}}<!--
 
      --><!--
 
    -->|<!--
 
      -->{{#vardefine: varAcceptedText|{{#ifeq: {{#show: {{{topic|}}}|?Topic Type|link=none}}|Definitional|definitions of the term are|answers to the question are}}|}}<!--
 
      --><!--
 
    -->}}<!-- switch
 
    --><!--
 
    -->In {{#var: varCommunityPrint}}, the accepted {{#var: varAcceptedText}}&#32;<!--
 
    --><!--
 
 
 
    --><!-- For each subject retrieve and group the answers:
 
    --><!--
 
    -->{{#arrayprint: varSubjects||varSubject|<!--
 
    --><!--
 
 
 
    --><!--
 
    --><!-- Create an array of theories with that subject
 
    --><!--
 
    -->{{#arraydefine: varSubjectTheories|<!--
 
    --><!--
 
      -->{{#arrayprint: varTheories||varTheory|<!--
 
      --><!--
 
      -->{{#vardefine: varTheorySubject| {{#show: varTheory|?Subject|link=none}} }}<!--
 
      --><!--  
 
      --><!-- include the theory only if it has the right subject
 
      -->{{#ifeq: {{#var: varTheorySubject}}|varSubject|varTheory,|}}<!--
 
      --><!--
 
      -->}}<!-- arrayprint theories
 
      --><!--
 
    -->}}<!-- arraydefine subject's theories
 
    -->{{#arrayunique: varSubjectTheories}}<!--
 
    --><!--
 
    --><!-- Check the size of the array:
 
    -->{{#switch: {{#arraysize: varSubjectTheories}}<!--
 
     
 
      -->|0=<!--
 
      --><!-- Nothing to print
 
 
 
      -->|1=<!--
 
      --><!-- One object: use the theory's Formulation Text
 
      -->"{{#show: {{#arrayindex: varSubjectTheories|0}}|?Formulation Text|link={{#ifeq: {{{link|no}}}|yes|all|none}}|}}"&#32;<!--
 
      --><!--
 
 
 
      -->|<!--
 
      --><!-- Multiple answers
 
 
 
      --><!-- Create an array of objects
 
      --><!--
 
      -->{{#arraydefine: varSubjectObjects|<!--
 
      --><!--
 
        -->{{#arrayprint: varSubjectTheories||varTheory|<!--
 
        -->{{#show: varTheory|?Object|link=none}},<!--
 
        -->}}<!-- arrayprint theories
 
        --><!--
 
      -->}}<!-- arraydefine objects
 
      -->{{#arrayunique: varSubjectObjects}}<!--
 
 
 
      --><!-- Print
 
      --><!--
 
      -->"{{DecodeTextFormula|formula={{#var: varMultipleFormula}}|subject=varSubject|object={{#arrayprint: varSubjectObjects}}|}}"<!--
 
      --><!--
 
 
 
    -->}}<!-- switch
 
    --><!--
 
    -->|print=pretty}}<!-- arrayprint subjects
 
    --><!--
 
 
 
 
 
   -->|<!--
 
    --><!-- No multiple answer formula is given: print them all one after the other
 
    --><!--
 
    -->{{#vardefine: varAcceptedText|{{#ifeq: {{#show: {{{topic|}}}|?Topic Type|link=none}}|Definitional|definitions of the term are|answers to the question are}}|}}<!--
 
    -->In {{#var: varCommunityPrint}}, the accepted {{#var: varAcceptedText}}&#32;<!--
 
    --><!--
 
    --><!--
 
    -->{{#arrayprint: varTheories||varTheory|<!--
 
    -->"{{#show: varTheory|?Formulation Text|link=none}}"<!--
 
    --><!--
 
    -->|print=pretty}}.&#32;<!-- arrayprint
 
    --><!--
 
 
 
 
 
   -->}}<!-- if multiple formula
 
 
   --><!--
 
   --><!--
 
 
 
  
 
   --><!--
 
   --><!--
 
   -->{{{outro|}}}<!--
 
   -->{{{outro|}}}<!--
 +
 
-->}}<!-- switch
 
-->}}<!-- switch
 
--></includeonly>
 
--></includeonly>

Revision as of 16:59, 27 February 2023

This template is used to print the formulations of theories accepted by the community on the given topic. It prints the formulations only by grouping them as needed. E.g.:

Suppose the question Epistemic Stances Towards Theories has several accepted answers, such as:

  • “The stance of theory acceptance can be taken towards theories.”
  • “The stance of theory pursuit can be taken towards theories.”
  • “The stance of theory use can be taken towards theories.”

The template will print:

  • “The stances of theory acceptance, theory pursuit, and theory use can be taken towards theories.”


TODO: FIX THIS


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

Parameters:

  • |community= - the community.
  • |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.
  • |link= - if all, then the links to pages will be printed; otherwise (default) no links will be added.

NOTE:

  • |communityfirst= - is UNAVAILABLE, since the community should be printed first; otherwise it looks ugly.