Difference between revisions of "Template:Has person"

From Crews Genealogy Wiki: focusing on the Wiregrass south, and related families
Jump to navigation Jump to search
Line 1: Line 1:
{{#ifeq:{{{link|}}}|none|{{#if:{{{surname|}}}|<!--has surname-->[[:Category:{{{surname|}}}]]|<!--doesn't have surname-->{{#if:{{{alt|}}}|<!--no surname and alt exists-->{{#if:{{{first name|}}}|<!--no surname and alt exists with first name-->[[Category:{{{|last name|}}}]]|{{#if:{{#explode:{{{name}}}| |2}}|<!--show third word-->[[Category:{{#explode:{{{name}}}| |2}}]]|<!--has less than three words show the second word-->[[Category:{{#explode:{{{name|}}}| |1}}]] }}}}|<!--no surname and no alt-->{{#if:{{{first name|}}}|<!--no surname and alt exists with first name-->[[Category:{{{|last name|}}}]]|{{#if:{{#explode:{{{name}}}| |2}}|<!--show third word-->[[Category:{{#explode:{{{name}}}| |2}}]]|<!--has less than three words show the second word-->[[Category:{{#explode:{{{name|}}}| |1}}]] }} }} }} }}<!--set has person stuff-->{{#if:{{{name|}}}|{{#set:has person={{{name|}}} }}|{{#set:has person={{#if:{{{first name|}}}|{{{first name|}}}|<!--show nothing-->}}{{#if:{{{middle name|}}}|&ensp;{{{middle name|}}}|<!--show nothing-->}}{{#if:{{{last name|}}}|&ensp;{{{last name|}}}|<!--show nothing-->}}{{#if:{{{suffix|}}}|&ensp;{{{suffix|}}}|<!--show nothing-->}}{{#if: {{{id|}}}|&ensp;({{{id|}}})|<!--show nothing-->}} }} }}|{{#if:{{{name|}}}|<!--name given-->{{#if:{{{alt|}}}|<!--name and alt given-->[[{{{name|}}}{{#!:|}}{{{alt|}}}]]|<!--name but no alt-->[[{{{name|}}}]]}}|<!--no name given-->{{#if:{{{alt|}}}|<!--no name. with alt given-->[[{{#if:{{{first name|}}}|{{{first name|}}}|<!--show nothing-->}}{{#if:{{{middle name|}}}|&ensp;{{{middle name|}}}|<!--show nothing-->}}{{#if:{{{last name|}}}|&ensp;{{{last name|}}}|<!--show nothing-->}}{{#if:{{{suffix|}}}|&ensp;{{{suffix|}}}|<!--show nothing-->}}{{#if: {{{id|}}}|&ensp;({{{id|}}})|<!--show nothing-->}}{{#!:|}}{{{alt|}}}]]|<!--no name no alt-->[[{{#if:{{{first name|}}}|{{{first name|}}}|<!--show nothing-->}}{{#if:{{{middle name|}}}|&ensp;{{{middle name|}}}|<!--show nothing-->}}{{#if:{{{last name|}}}|&ensp;{{{last name|}}}|<!--show nothing-->}}{{#if:{{{suffix|}}}|&ensp;{{{suffix|}}}|<!--show nothing-->}}{{#if: {{{id|}}}|&ensp;({{{id|}}})|<!--show nothing-->}}]]}}}}{{#if:{{{surname|}}}|<!--has surname-->[[Category:{{{surname|}}}]]|<!--doesn't have surname-->{{#if:{{{alt|}}}|<!--no surname and alt exists-->{{#if:{{{first name|}}}|<!--no surname and alt exists with first name-->[[Category:{{{|last name|}}}]]|{{#if:{{#explode:{{{name}}}| |2}}|<!--show third word-->[[Category:{{#explode:{{{name}}}| |2}}]]|<!--has less than three words show the second word-->[[Category:{{#explode:{{{name|}}}| |1}}]] }} }}|<!--no surname and no alt-->{{#if:{{{first name|}}}|<!--no surname and alt exists with first name-->[[Category:{{{last name|}}}]]|{{#if:{{#explode:{{{name}}}| |2}}|<!--show third word-->[[Category:{{#explode:{{{name}}}| |2}}]]|<!--has less than three words show the second word-->[[Category:{{#explode:{{{name|}}}| |1}}]] }} }} }} }}{{#if:{{{name|}}}|{{#set:has person={{{name|}}} }}|{{#set:has person={{#if:{{{first name|}}}|{{{first name|}}}|<!--show nothing-->}}{{#if:{{{middle name|}}}|&ensp;{{{middle name|}}}|<!--show nothing-->}}{{#if:{{{last name|}}}|&ensp;{{{last name|}}}|<!--show nothing-->}}{{#if:{{{suffix|}}}|&ensp;{{{suffix|}}}|<!--show nothing-->}}{{#if: {{{id|}}}|&ensp;({{{id|}}})|<!--show nothing-->}} }} }} }}<noinclude>{{documentation}}</noinclude>
 
 
 
<!--define the name-->
 
<!--define the name-->
{{#vardefine:full name|{{#if:{{{first name|}}}{{{middle name|}}}{{{last name|}}}{{{id|}}}|{{{first name|}}} {{{middle name|}}} {{{last name|}}} {{{id|}}} | {{{name|}}} }} }}'''testing the variable: ''' {{#var:full name}}
+
{{#vardefine:full name|{{#if:{{{first name|}}}{{{middle name|}}}{{{last name|}}}{{{suffix|}}}{{{id|}}}|{{{first name|}}} {{{middle name|}}} {{{last name|}}} {{{suffix|}}} {{{id|}}} | {{{name|}}} }} }}   {{#var:full name}}
  
 
<!--outline -->
 
<!--outline -->
 
{{#switch: {{{link|}}}
 
{{#switch: {{{link|}}}
 
  |<!--link = none-->none = {{#if {{{alt|}}}
 
  |<!--link = none-->none = {{#if {{{alt|}}}
       |alt exists
+
       |{{{alt|}}}
       |alt doesn't exist }}
+
       |{{#var:full name}} }}
 
  |<!--link != none -->#default = {{#if {{{alt|}}}
 
  |<!--link != none -->#default = {{#if {{{alt|}}}
 
       |alt exists  
 
       |alt exists  
 
       |alt doesn't exist }}
 
       |alt doesn't exist }}
 
}}
 
}}
 +
 +
<!--assign to surname categoy and set surname-->
 +
[[Category:{{get surname|{{#var:full name}} }}]]

Revision as of 09:40, 17 February 2019


{{#if

      |alt exists 
      |alt doesn't exist }}

[[Category:]]