Difference between revisions of "Template:PrintDatePropertyInOnString"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
(Created page with "<noinclude> This template is used to return a nicely formatted string of "on 24 August 2016", "in August 2016", or "in 2016" depending on which parts of the date type property...")
 
Line 7: Line 7:
 
* <code><nowiki>|object=</nowiki></code> - the full page name of the object.
 
* <code><nowiki>|object=</nowiki></code> - the full page name of the object.
 
* <code><nowiki>|property=</nowiki></code> - the name of the property.
 
* <code><nowiki>|property=</nowiki></code> - the name of the property.
 +
* <code><nowiki>|link=</nowiki></code> - determines whether the value is to be printer as a link to the respective page (where available); possible values are ''none'', ''subject'', ''all''. If not given ''all'' is the default.
  
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
Line 12: Line 13:
 
  --><!-- check if the date part is assigned
 
  --><!-- check if the date part is assigned
 
  -->|{{#if: {{#show: {{{object|}}}|?{{{property|}}} Day|link=none}}|on|in}}<!-- "on" if the day is stored on, "in" otherwise  
 
  -->|{{#if: {{#show: {{{object|}}}|?{{{property|}}} Day|link=none}}|on|in}}<!-- "on" if the day is stored on, "in" otherwise  
   -->&#32;{{#show: {{{object|}}}|?{{{property|}}}|link=none}}<!-- add the date itself
+
   -->&#32;{{#show: {{{object|}}}|?{{{property|}}}|link={{{link|}}}}}<!-- add the date itself
 
-->}}<!-- if property
 
-->}}<!-- if property
 
--></includeonly>
 
--></includeonly>

Revision as of 10:19, 24 August 2016

This template is used to return a nicely formatted string of "on 24 August 2016", "in August 2016", or "in 2016" depending on which parts of the date type property are given. The template assumes that the data is previously stored with Template:SetDatePropertyValue.

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

Parameters:

  • |object= - the full page name of the object.
  • |property= - the name of the property.
  • |link= - determines whether the value is to be printer as a link to the respective page (where available); possible values are none, subject, all. If not given all is the default.