Difference between revisions of "Template:PrintTermInheritedQuestionsHeaders"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 22: Line 22:
 
   -->{{#arraydefine: varHeritableQuestions<!--
 
   -->{{#arraydefine: varHeritableQuestions<!--
 
   -->|{{#ask:<!--
 
   -->|{{#ask:<!--
     -->[[Category::Topic]]<!--
+
     -->[[Category:Topic]]<!--
 
     -->[[Subfield::{{{subfield|Dynamics}}}]]<!--
 
     -->[[Subfield::{{{subfield|Dynamics}}}]]<!--
 
     -->[[Subject::<q>[[-Ancestor items::{{{term|}}}]]</q>]]<!--  
 
     -->[[Subject::<q>[[-Ancestor items::{{{term|}}}]]</q>]]<!--  
Line 38: Line 38:
 
   -->{{#arrayprint: varHeritableQuestions||varQuestion<!--
 
   -->{{#arrayprint: varHeritableQuestions||varQuestion<!--
 
   -->|<!--
 
   -->|<!--
 +
    --><!-- get the variables to decode the title
 +
    -->{{#vardefine: varFormula|{{#show: varQuestion|?Question Title Formula|link=none}}}}<!--
 +
    -->{{#vardefine: varPredicate|{{#show: varQuestion|?Predicate|link=none}}}}<!--
 +
    -->{{#vardefine: varObject|{{#show: varQuestion|?Object Class|link=none}}}}<!--
 +
    --><!--
 
     -->{{#vardefine: varPage<!--
 
     -->{{#vardefine: varPage<!--
 
     -->|<!--
 
     -->|<!--
 
       -->{{DecodeTitleFormula<!--
 
       -->{{DecodeTitleFormula<!--
       -->|formula={{#show: varQuestion|?Question Title Formula|link=none}}<!--
+
       -->|formula={{#var: varFormula}}<!--
 
       -->|subject={{{term|}}}<!--
 
       -->|subject={{{term|}}}<!--
       -->|predicate={{#show: varQuestion|?Predicate|link=none}}<!--
+
       -->|predicate={{#var: varPredicate}}<!--
       -->|object={{#show: varQuestion|?Object Class|link=none}}<!--
+
       -->|object={{#var: varObject}}<!--
 
       -->}}<!--
 
       -->}}<!--
 
     -->}}<!--vardefine
 
     -->}}<!--vardefine
 
     --><!--
 
     --><!--
 
     --><!-- TODO: add the headers
 
     --><!-- TODO: add the headers
     --><!--
+
     -->{{#var: varPage}}<!--
    --><!-- check if the page exists
 
    -->{{#ifexist:{{#var: varPage}}<!--
 
    -->|{{#if: {{{link|}}}|[[{{#var: varPage}}]]|{{#var: varPage}}|}}<!-- link to the page
 
    -->|<!-- doesn't exist, check if the formlink is expected
 
      -->{{#if: {{{link|}}}<!--
 
      -->|<!-- return the formlink
 
        -->{{#formlink:form=Topic|link text={{#var: varPage}}|target={{#var: varPage}}|query string=Topic[Subject]={{{term|}}}&Topic[Inherited From]=varQuestion|}}<!--
 
      -->|<!-- form link is not needed; return the name only
 
        -->{{#var: varPage}}<!--
 
      -->}}<!-- if 
 
    -->}}<!-- if exists
 
 
     --><!--
 
     --><!--
 
   -->}}<!--arrayprint  
 
   -->}}<!--arrayprint  

Revision as of 16:42, 19 January 2023

This template is used to print a list of question that a term can potentially inherit. The template searches for the heritable questions of the term's ancestors and decodes the formula of the question's title. If a page like that already exists, it provides a link to that page. If a page doesn't exist, it prints a redlink to the respective form with prefilled parameters for the easy creation of the page.

The template is a work in progress.

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

Parameters:

  • |term= - the term.
  • |subfield= - {Ontology, Dynamics, etc.}. Default is dynamics.
  • |link= - if not empty, a link to the respective page or a formlink (if the page doesn't exist) will be added.

unused for now:

  • |bullets= - if yes, a bullet-list of answers will be produced. Otherwise,
  • |linebreak= - if yes, each community 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.