Template:Person: Difference between revisions

From TITAF TANGOWIKI
No edit summary
Tag: Reverted
No edit summary
Tags: Manual revert Reverted
Line 1: Line 1:
<noinclude>
<noinclude>
<!-- Documentation or usage instructions here -->
<!--{{#template_params:NameFirst (label=First name (civil);property=PersonNameFirst)|NameMiddle (label=Middle name (civil);property=PersonNameMiddle)|NameNick (label=Nick name;property=PersonNameNick)|NameLast (label=Last name (civil);property=PersonNameLast)|NamePseudonym (label=Pseudonym;property=PersonNamePseudonym)|NameAlt (label=Alternative name;property=PersonNameAlt)|Role (list;property=PersonRole)|Country (label=Country of origin;property=PersonCountry)|DateBirth (label=Date of birth;property=PersonDateBirth)|DateDeath (label=Date of death;property=PersonDateDeath)|Wikidata_ID (label=Wikidata ID;property=Wikidata_ID)}}-->
</noinclude><includeonly>
</noinclude><includeonly>


<!-- Fetch Data from Wikidata if Wikidata_ID is provided -->
{{#if:{{{Wikidata_ID|}}}|
  {{#get_web_data:
    url=https://www.wikidata.org/w/api.php?action=wbgetentities&ids={{{Wikidata_ID}}}&format=json;
    format=json;
    data=birthday=entities.{{{Wikidata_ID}}}.claims.P569.0.mainsnak.datavalue.value.time,
        deathday=entities.{{{Wikidata_ID}}}.claims.P570.0.mainsnak.datavalue.value.time
  }}
}}
<!-- Display title and sorting -->
{{DISPLAYTITLE:{{{NameFirst}}}{{#if:{{{NameNick|}}}|&#32;({{{NameNick}}})|}} {{{NameLast}}}}}
{{DISPLAYTITLE:{{{NameFirst}}}{{#if:{{{NameNick|}}}|&#32;({{{NameNick}}})|}} {{{NameLast}}}}}
{{DEFAULTSORT:{{{NameLast}}},{{{NameFirst}}}}}
{{DEFAULTSORT:{{{NameLast}}},{{{NameFirst}}}}}


<!-- Table of Person Data -->
{| class="person"
{| class="wikitable"
! First name
! First name
| [[PersonNameFirst::{{{NameFirst|}}}]]
| [[PersonNameFirst::{{{NameFirst|}}}]]
Line 56: Line 44:
|}
|}


<!-- Wikidata-derived dates (formatted nicely) -->
<!-- Fetch Data from Wikidata If Wikidata_ID is Provided -->
{{#if:{{#external_value:birthday}}|
{{#if:{{{Wikidata_ID|}}}|
'''Wikidata Date of Birth:''' {{#time:j F Y|{{#replace:{{#external_value:birthday}}|+|}}}}<br>
  {{#get_web_data:
  url=https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q381843&format=json;
  format=json;
  data=birthday=entities.Q381843.claims.P569.0.mainsnak.datavalue.value.time
}}
 
* Wikidata Date of Birth: {{#external_value:birthday}}
 
}}
}}
{{#if:{{#external_value:deathday}}|
 
'''Wikidata Date of Death:''' {{#time:j F Y|{{#replace:{{#external_value:deathday}}|+|}}}}<br>
{{#if:{{{Wikidata_ID|}}}|
  {{#get_web_data:
    url=https://www.wikidata.org/w/api.php?action=wbgetentities&ids={{{Wikidata_ID}}}&format=json;
    format=json;
    data=full_response=entities.{{{Wikidata_ID}}}
  }}
 
  * Raw API Response: {{#external_value:full_response}}
}}
}}


[[Category:Person]]
[[Category:Person]]
 
</includeonly><noinclude>[[Category:PersonClass]]</noinclude>
</includeonly><noinclude>
[[Category:PersonClass]]
</noinclude>

Revision as of 13:22, 6 April 2025