Difference between revisions of "Template:Header/year"

From En JW United
Jump to navigation Jump to search
Line 14: Line 14:
 
Check if the input is a number
 
Check if the input is a number
  
  -->{{#ifeq:{{is number|{{{year|{{{1|}}}}}} }}|1
+
      |<!-- YES IT IS A NUMBER: perform as normal (nb: have to include years with digits below 4) -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{year|{{{1|}}}}}} works]]}}
 
      |<!-- NO IT IS NOT A NUMBER: more if statements and switches to select the right thing.
 
 
 
          First, add temporary tracking category (unless nocat is true) -->{{#ifeq:{{{nocat|}}}|1||[[Category:Works with non-numeric dates]]}}<!--
 
 
 
          Now some checks to determine the type on non-numeric input:
 
 
 
          -->{{#ifeq:{{{year|{{{1|}}}}}|?
 
              |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 
              |<!--ELSE check if the input "unknown"
 
 
 
            -->{{#ifeq:{{{year|{{{1|}}}}}}|unknown
 
                |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 
 
 
             
 
              }}<!-- end ifeq "unknown" -->
 
            }}<!-- end ifeq ? -->
 
      }}<!-- end ifeq isnumber -->
 
 
     |{{#ifeq:{{{nocat|}}}|1||[[Category:Undated works‎]]}}
 
     |{{#ifeq:{{{nocat|}}}|1||[[Category:Undated works‎]]}}
 
   }}<!-- if value in parameter {{{year|{{{1}}}}}} -->
 
   }}<!-- if value in parameter {{{year|{{{1}}}}}} -->

Revision as of 06:47, 4 August 2019

{{#if:Template

    |
    |