From World Afropedia

Difference between revisions of "Template:Header/year"

Jump to: navigation, search
m (1 revision)
(restore subjectspace #if)
Line 10: Line 10:
 
Check if the input is blank or not
 
Check if the input is blank or not
  
-->{{#if:{{{1|}}}|<!--if something, continue...
+
-->{{#if:{{{year|{{{1|}}}}}}|<!--if something, continue...
  
 
Check if the input is a number
 
Check if the input is a number
  
   -->{{#ifeq:{{is number|{{{1|}}}}}|1
+
   -->{{#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;({{{1|}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{1|}}} works]]}}
+
       |<!-- 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.
 
       |<!-- NO IT IS NOT A NUMBER: more if statements and switches to select the right thing.
  
Line 22: Line 22:
 
           Now some checks to determine the type on non-numeric input:
 
           Now some checks to determine the type on non-numeric input:
  
           -->{{#ifeq:{{{1|}}}|?
+
           -->{{#ifeq:{{{year|{{{1|}}}}}|?
 
               |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 
               |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 
               |<!--ELSE check if the input "unknown"
 
               |<!--ELSE check if the input "unknown"
  
             -->{{#ifeq:{{{1|}}}|unknown
+
             -->{{#ifeq:{{{year|{{{1|}}}}}}|unknown
 
                 |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 
                 |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 
                 |<!--ELSE check if the input is a decade  
 
                 |<!--ELSE check if the input is a decade  
  
               -->{{#ifeq:{{is decade|{{{1|}}}|function=3}}|1
+
               -->{{#ifeq:{{is decade|{{{year|{{{1|}}}}}}|function=3}}|1
                     |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{1|}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{1|}}} works]][[Category:Works of uncertain date]]}}
+
                     |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{year|{{{1|}}}}}} works]][[Category:Works of uncertain date]]}}
 
                     |<!--ELSE check if the input is a century
 
                     |<!--ELSE check if the input is a century
  
                   -->{{#ifeq:{{is century|{{{1|}}}|function=3}}|1
+
                   -->{{#ifeq:{{is century|{{{year|{{{1|}}}}}}|function=3}}|1
                       |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{1|}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{1|}}} works]][[Category:Works of uncertain date]]}}
+
                       |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{year|{{{1|}}}}}} works]][[Category:Works of uncertain date]]}}
 
                       |<!--ELSE check if the input is Before Common Era (BCE)  
 
                       |<!--ELSE check if the input is Before Common Era (BCE)  
  
                     -->{{#ifeq:{{is year|{{{1|}}}|function=3}}|1
+
                     -->{{#ifeq:{{is year|{{{year|{{{1|}}}}}}|function=3}}|1
                         |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{1|}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{1|}}} works]]}}
+
                         |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{year|{{{1|}}}}}} works]]}}
 
                         |<!--ELSE check more complicated 2-part inputs
 
                         |<!--ELSE check more complicated 2-part inputs
  
                       -->{{#if:{{#titleparts:{{{1|}}}|1|2}}<!-- if there is a 2nd part to the input, separated by a slash
+
                       -->{{#if:{{#titleparts:{{{year|{{{1|}}}}}}|1|2}}<!-- if there is a 2nd part to the input, separated by a slash
                         -->|{{#switch:{{lc:{{#titleparts:{{{1|}}}|1|1}}}}<!-- check the 1st part -->
+
                         -->|{{#switch:{{lc:{{#titleparts:{{{year|{{{1|}}}}}}|1|1}}}}<!-- check the 1st part -->
 
                               | c
 
                               | c
 
                               | c.
 
                               | c.
Line 49: Line 49:
  
 
                                       -->{{#ifeq:{{Is year
 
                                       -->{{#ifeq:{{Is year
                                                   | input    = {{#titleparts:{{{1|}}}|1|2}}
+
                                                   | input    = {{#titleparts:{{{year|{{{1|}}}}}}|1|2}}
 
                                                   | function = 3
 
                                                   | function = 3
 
                                                 }}
 
                                                 }}
 
                                           |1
 
                                           |1
                                           |{{#ifeq:{{{noprint|}}}|1||&nbsp;(c. {{#titleparts:{{{1|}}}|1|2}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{is year|input={{#titleparts:{{{1|}}}|1|2}}|function=1}} works]][[Category:Works of uncertain date]]}}<!-- ie. use the corresponding decade-based category for sorting this work with a "circa"-style date -->
+
                                           |{{#ifeq:{{{noprint|}}}|1||&nbsp;(c. {{#titleparts:{{{year|{{{1|}}}}}}|1|2}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{is year|input={{#titleparts:{{{year|{{{1|}}}}}}|1|2}}|function=1}} works]][[Category:Works of uncertain date]]}}<!-- ie. use the corresponding decade-based category for sorting this work with a "circa"-style date -->
 
                                           |<!-- ELSE
 
                                           |<!-- ELSE
  
                                         -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{1|}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works with unrecognised dates]][[Category:Undated works‎]]}}<!-- a "circa"-style date with a non-year 2nd part get categorised as unrecognised and undated -->
+
                                         -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works with unrecognised dates]][[Category:Undated works‎]]}}<!-- a "circa"-style date with a non-year 2nd part get categorised as unrecognised and undated -->
 
                                         }}<!-- end ifeq isyear titleparts (2nd part) -->
 
                                         }}<!-- end ifeq isyear titleparts (2nd part) -->
 
                               | #default = <!-- ELSE
 
                               | #default = <!-- ELSE
  
                                         -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{1|}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works with unrecognised dates]][[Category:Undated works‎]]}}<!-- if a multi-part date but no matches, categorise as unrecognised and undated -->
+
                                         -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works with unrecognised dates]][[Category:Undated works‎]]}}<!-- if a multi-part date but no matches, categorise as unrecognised and undated -->
 
                             }}<!-- end switch titleparts (1st part) -->
 
                             }}<!-- end switch titleparts (1st part) -->
 
                             |<!-- ELSE  
 
                             |<!-- ELSE  
  
                           -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{1|}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works with unrecognised dates]][[Category:Undated works‎]]}}<!-- if the input is STILL not recognised, categorise it as unrecognised and undated -->
+
                           -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works with unrecognised dates]][[Category:Undated works‎]]}}<!-- if the input is STILL not recognised, categorise it as unrecognised and undated -->
 
                           }}<!-- end if titleparts -->
 
                           }}<!-- end if titleparts -->
 
                       }}<!-- end ifeq year BCE -->
 
                       }}<!-- end ifeq year BCE -->
Line 73: Line 73:
 
       }}<!-- end ifeq isnumber -->
 
       }}<!-- end ifeq isnumber -->
 
     |{{#ifeq:{{{nocat|}}}|1||[[Category:Undated works‎]]}}
 
     |{{#ifeq:{{{nocat|}}}|1||[[Category:Undated works‎]]}}
   }}<!-- if value in parameter {{{1}}} -->
+
   }}<!-- if value in parameter {{{year|{{{1}}}}}} -->
 
}}<!-- if SUBJECTSPACE -->
 
}}<!-- if SUBJECTSPACE -->

Revision as of 10:03, 23 January 2015

Personal tools