Template:Person: Difference between revisions

From elijah
Jump to navigation Jump to search
No edit summary
No edit summary
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- https://elijahwiki.info/index.php/Template:Person -->
<includeonly>
<includeonly>
<!-- Categorize all described files (optional) -->
__NOFACTBOX__
[[Category:People]]
[[Category:People]]


{{#if:{{{HasName|}}}|[[HasName::{{{HasName}}}]]}}
<!-- ==========================================================
{{#if:{{{HasAltName|}}}|[[HasAltName::{{{HasAltName}}}]]}}
    DATA STORAGE (THE "SET" BLOCK)
{{#if:{{{HasDateOfBirth|}}}|[[HasDateOfBirth::{{{HasDateOfBirth}}}]]}}
    We use #set to store data silently. No hidden divs needed.
{{#if:{{{HasDateOfDeath|}}}|[[HasDateOfDeath::{{{HasDateOfDeath}}}]]}}
    ========================================================== -->
{{#if:{{{HasPlaceOfBirth|}}}|[[HasPlaceOfBirth::{{{HasPlaceOfBirth}}}]]}}
{{#set:
{{#if:{{{HasPlaceOfDeath|}}}|[[HasPlaceOfDeath::{{{HasPlaceOfDeath}}}]]}}
|HasType={{{HasType|PublicFigure}}}
{{#if:{{{HasWikidataID|}}}|[[HasWikidataID::{{{HasWikidataID}}}]]}}
|HasName={{{HasName|}}}
{{#if:{{{HasMazalID|}}}|[[HasMazalID::{{{HasMazalID}}}]]}}
|HasAltName={{{HasAltName|}}}
{{#if:{{{HasImage|}}}|[[HasImage::{{{HasImage}}}]]}}
|HasHebName={{{HasHebName|}}}
{{#if:{{{HasArticle|}}}|[[HasArticle::{{{HasArticle}}}]]}}
|HasYiddishName={{{HasYiddishName|}}}
{{#if:{{{HasProfession|}}}|[[HasProfession::{{{HasProfession}}}]]}}
|HasDateOfBirth={{{HasDateOfBirth|}}}
{{#if:{{{HasURL|}}}|[[HasURL::{{{HasURL}}}]]}}
|HasDateOfDeath={{{HasDateOfDeath|}}}
<!--{{#if:{{{HasType|}}}|[[HasType::{{{HasType}}}]]}} -->
|HasPlaceOfBirth={{{HasPlaceOfBirth|}}}
{{#if:{{{HasType|PublicFigure}}}|[[HasType::{{#if:{{{HasType|}}}|{{{HasType}}}|PublicFigure}}]]}}
|HasPlaceOfDeath={{{HasPlaceOfDeath|}}}
|HasWikidataID={{{HasWikidataID|}}}
|HasMazalID={{{HasMazalID|}}}
|HasVIAFID={{{HasVIAFID|}}}
|HasImage={{{HasImage|}}}
|HasArticle={{{HasArticle|}}}
|HasBibLink={{{HasBibLink|}}}
|HasYIVOLink={{{HasYIVOLink|}}}
|HasWikiLink={{{HasWikiLink|}}}
}}
 
<!-- Handle List Properties (Split by semicolon or comma) -->
<!-- 1. URLs: We assume raw text storage for JSON export simplicity,
    but validation happens on display. -->
{{#if:{{{HasURL|}}}|
  {{#arraymap:{{{HasURL|}}}|;|@@|{{#set:HasURL=@@}} }}
}}
 
<!-- Handle Profession List (Controlled Vocabulary) -->
<!-- We split by semicolon so "Rabbi;Author" becomes two distinct data values -->
{{#if:{{{HasProfession|}}}|
  {{#arraymap:{{{HasProfession|}}}|;|@@|{{#set:HasProfession=@@}}|}}
}}


<div class="person" style="border:1px solid #ddd; padding:.8em; background:#fafafa; margin:.8em 0; overflow:auto;">
<!-- ==========================================================
    VISUAL DISPLAY (THE CARD)
    ========================================================== -->
<div class="person-card" style="border:1px solid #ccc; background:#f9f9f9; padding:1em; display:flow-root; box-shadow: 2px 2px 5px rgba(0,0,0,0.1);">


   <!-- Float the image to the right -->
   <!-- Image Block -->
   {{#if:{{{HasImage|}}}|
   {{#if:{{{HasImage|}}}|
     <div style="float:right; margin:0 0 .5em .8em;">
     <div style="float:right; margin-left:1em; max-width:200px;">
       [[{{{HasImage}}}|thumb|200px|{{{HasName|}}}]]
       [[{{#show: {{{HasImage|}}} |?HasFile |link=none}}|thumb|200px|center|{{{HasName|}}}]]
     </div>
     </div>
   }}
   }}


   <!-- Person details -->
   <!-- Header -->
   {{#if:{{{HasName|}}}|'''Name:''' {{{HasName}}}<br/>}}
  <h2 style="margin-top:0;">{{{HasName|{{PAGENAME}}}}}</h2>
  {{#if:{{{HasAltName|}}}|'''Alternate name:''' {{{HasAltName}}}<br/>}}
 
   {{#if:{{{HasType|}}}|'''Type:''' {{{HasType}}}<br/>}}
  <div class="person-data">
  {{#if:{{{HasDateOfBirth|}}}|'''Date of birth:''' {{{HasDateOfBirth}}}<br/>}}
  <!-- Names -->
   {{#if:{{{HasPlaceOfBirth|}}}|'''Place of birth:''' {{{HasPlaceOfBirth}}}<br/>}}
   {{#if:{{{HasHebName|}}}{{{HasYiddishName|}}}|
   {{#if:{{{HasDateOfDeath|}}}|'''Date of death:''' {{{HasDateOfDeath}}}<br/>}}
    <p>
   {{#if:{{{HasPlaceOfDeath|}}}|'''Place of death:''' {{{HasPlaceOfDeath}}}<br/>}}
    {{#if:{{{HasHebName|}}}|'''Hebrew:''' <span lang="he" dir="rtl">{{{HasHebName}}}</span> &bull; }}
  {{#if:{{{HasProfession|}}}|'''Known for:''' {{{HasProfession}}}<br/>}}
    {{#if:{{{HasYiddishName|}}}|'''Yiddish:''' <span lang="yi" dir="rtl">{{{HasYiddishName}}}</span>}}
   {{#if:{{{HasArticle|}}}|'''Related article:''' {{{HasArticle}}}<br/>}}
    </p>
   {{#if:{{{HasWikidataID|}}}|'''Wikidata ID:''' {{{HasWikidataID}}}<br/>}}
   }}
   {{#if:{{{HasMazalID|}}}|'''Mazal ID:''' {{{HasMazalID}}}<br/>}}
 
   {{#if:{{{HasURL|}}}|'''External link:''' [{{{HasURL}}} link]<br/>}}
  <!-- Vital Statistics -->
  <ul>
    {{#if:{{{HasDateOfBirth|}}}|<li>'''Born:''' {{{HasDateOfBirth}}}{{#if:{{{HasPlaceOfBirth|}}}| in [[{{{HasPlaceOfBirth}}}]]}}</li>}}
    {{#if:{{{HasDateOfDeath|}}}|<li>'''Died:''' {{{HasDateOfDeath}}}{{#if:{{{HasPlaceOfDeath|}}}| in [[{{{HasPlaceOfDeath}}}]]}}</li>}}
  </ul>
 
  <!-- Professional Data -->
   {{#if:{{{HasProfession|}}}|
    '''Known for:'''  
    <!-- {{#arraymap:{{{HasProfession|}}}|;|@@|[[Term:@@|@@]]|, }} --> <!-- Auto-links to Term:Namespace -->
    <!--
      We use [[HasProfession::@@]] syntax here.
      This displays the text "@@" (e.g. Rabbi), but clicking it
      searches the wiki for other people with that same property value.
    -->
    {{#arraymap:{{{HasProfession|}}}|;|@@|[[HasProfession::@@]]|, }}
 
    <br/>
  }}
 
   {{#if:{{{HasArticle|}}}|'''Related Article:''' [[{{{HasArticle}}}]] | '''No Related Article''' <br/>}}
 
   <!-- Identifiers (Crucial for TEI/MARC21 Interop) -->
  {{#if:{{{HasWikidataID|}}}{{{HasVIAFID|}}}{{{HasMazalID|}}}|
    <hr style="margin:0.5em 0; border:0; border-top:1px dashed #ccc;"/>
    <small style="color:#666;">
    {{#if:{{{HasWikidataID|}}}|'''Wikidata:''' [https://www.wikidata.org/wiki/{{{HasWikidataID}}} {{{HasWikidataID}}}] &bull; }}
    {{#if:{{{HasVIAFID|}}}|'''VIAF:''' [https://viaf.org/viaf/{{{HasVIAFID}}} {{{HasVIAFID}}}] &bull; }}
    {{#if:{{{HasMazalID|}}}|'''Mazal ID:''' {{{HasMazalID}}}}}
    </small>
    <br/>
  }}
 
   {{#if:{{{HasBibLink|}}}|'''Selected bibliography:'''[[{{{HasBibLink}}}]] |'''No Selected bibliography''' <br/>}}
   {{#if:{{{HasYIVOLink|}}}|'''YIVO Encyclopedia entry:'''[[{{{HasYIVOLink}}}]] |'''No YIVO Encyclopedia entry''' <br/>}}
   {{#if:{{{HasWikiLink|}}}|'''Wikipedia entry:'''[[{{{HasWikiLink}}}]] |'''No Wikipedia entry''' <br/>}}
 
  <!-- Other External Links with Validation -->
   {{#if:{{{HasURL|}}}|
    '''External Links:'''<br/>
    {{#arraymap:{{{HasURL}}}|;|@@|
      {{#if: {{#rmatch:@@|^https?://}} | [@@ Link] | <!-- Invalid hidden --> }}
    |<br/>}}
  }}
  </div>


</div>
</div>
</includeonly>
</includeonly>


<noinclude>
<noinclude>
Line 54: Line 122:
<pre>
<pre>
{{Person
{{Person
  |HasName=Jacob ben Moses
  |HasName=Perl ,Joseph
  |HasAltName=Yaakov ben Moshe
  |HasHebName=פרל, יוסף
|HasYiddishName=פערל, יוסף
  |HasType=PublicFigure
  |HasType=PublicFigure
  |HasDateOfBirth=1725
  |HasDateOfBirth=1773
  |HasPlaceOfBirth=Community:Lviv
  |HasPlaceOfBirth=Community:Lviv
  |HasDateOfDeath=1790
  |HasDateOfDeath=1839
  |HasPlaceOfDeath=Community:Brody
  |HasPlaceOfDeath=Community:Brody
  |HasWikidataID=Q123456
  |HasWikidataID=Q123456
  |HasMazalID=MAZAL-000045
  |HasMazalID=MAZAL-000045
  |HasImage=File:Jacob_ben_Moses.jpg
|HasVIAFID=22945141
  |HasImage=Image:Josef Perl
  |HasArticle=Article:The Jewish Council of Lviv
  |HasArticle=Article:The Jewish Council of Lviv
  |HasProfession=Community leader and rabbinical scholar
  |HasProfession=Community leader and rabbinical scholar
  |HasURL=https://example.org/persons/jacob_ben_moses
  |HasURL=https://example.org/persons/jacob_ben_moses; https://en.wikipedia.org/wiki/Jacob_ben_Moses
|HasWikiLink=
|HasYIVOLink=
|HasBibLink=
}}
}}
</pre>
</pre>
</noinclude>
</noinclude>

Latest revision as of 20:25, 23 December 2025


Use this template on Person: pages to describe individual people.

Example:

{{Person
 |HasName=Perl ,Joseph
 |HasHebName=פרל, יוסף
 |HasYiddishName=פערל, יוסף
 |HasType=PublicFigure
 |HasDateOfBirth=1773
 |HasPlaceOfBirth=Community:Lviv
 |HasDateOfDeath=1839
 |HasPlaceOfDeath=Community:Brody
 |HasWikidataID=Q123456
 |HasMazalID=MAZAL-000045
 |HasVIAFID=22945141
 |HasImage=Image:Josef Perl
 |HasArticle=Article:The Jewish Council of Lviv
 |HasProfession=Community leader and rabbinical scholar
 |HasURL=https://example.org/persons/jacob_ben_moses; https://en.wikipedia.org/wiki/Jacob_ben_Moses
 |HasWikiLink=
 |HasYIVOLink=
 |HasBibLink=
}}