Difference between revisions of "Template:PrintTheoryTitleAuthorYearResource"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 14: Line 14:
  
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
--><!-- get the title of this theory
+
-->{{#if: {{{theory|}}}<!--
-->{{#vardefine: varTitle| {{#show: {{{theory|}}}|?Title}} |}}<!--
+
--><!--
--><!-- find if there are any other theories with this exact title
+
--><!-- get the title of this theory
-->{{#vardefine: varCount|{{#expr: {{#ask: [[Category:Descriptive Theory]] [[Title::{{#var:varTitle}}]]||format=count}} + {{#ask: [[Category:Normative Theory]] [[Title::{{#var:varTitle}}]]||format=count}} }}<!--
+
-->|{{#vardefine: varTitle|{{#show: {{{theory|}}}|?Title}}|}}<!--
-->}}<!-- vardefine Count
+
  --><!--
--><!--
+
  -->{{#if: {{#var: varTitle}}<!--
-->{{#switch: {{#var: varCount}}<!--
+
  -->|<!--
-->|1='''{{#var: varTitle}}''' was formulated by&#32;<!--
+
  -->|{{#vardefine: varTitle|{{{theory|}}}|}}<!-- the title is not found - use the theory name instead
-->|This version of '''{{#var: varTitle}}''' was formulated by&#32;<!--
+
  -->}}<!-- if
-->}}<!-- switch varCount
+
  --><!--
--><!--
+
  --><!-- find if there are any other theories with this exact title
-->{{PrintTheoryAuthors|theory={{{theory|}}}|link=all|pretty=yes}}<!--
+
  -->{{#vardefine: varCount|{{#ask: [[Category:Theory]] [[Title::{{#var:varTitle}}]]|format=count}} |}}<!-- vardefine Count
--> in {{#show: {{{theory|}}}|?Formulated Year|link=none}}.{{#if: {{#show: {{{theory|}}}|?Resource|link=none}}|[[CiteRef::{{#show: {{{theory|}}}|?Resource|link=none}}]]|}}</includeonly>
+
  --><!--
 +
  -->{{#switch: {{#var: varCount}}<!--
 +
  -->|0|1=''{{#var: varTitle}}'' was formulated by&#32;<!--
 +
  -->|This version of ''{{#var: varTitle}}'' was formulated by&#32;<!--
 +
  -->}}<!-- switch varCount
 +
  --><!--
 +
  -->{{PrintTheoryAuthors|theory={{{theory|}}}|link=all|pretty=yes}}<!--
 +
  --> in {{#show: {{{theory|}}}|?Formulated Year|link=none}}.{{#if: {{#show: {{{theory|}}}|?Resource|link=none}}|[[CiteRef::{{#show: {{{theory|}}}|?Resource|link=none}}]]|}}<!--
 +
  --><!--
 +
-->}}<!-- if theory
 +
--></includeonly>

Revision as of 20:28, 4 September 2016

This template is used to format the sentence that this formulation was suggested by such-and-such author in year such-and-such. It includes:

  • the title of the theory;
  • the names of the authors;
  • the formulation hear;
  • a link to the bibliographic resource, if any.

It also checks to see if there are any other theories with the same title; if there are several theories with the same title, the text will say "This version of the theory was formulated by...".

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

Parameters:

  • |theory= - the fullpagename of the theory.