Template:Person: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 9: | Line 9: | ||
<!-- Store semantic data invisibly --> | <!-- Store semantic data invisibly --> | ||
<div style="display:none;"> | <div style="display:none;"> | ||
{{#if:{{{HasType|PublicFigure}}}|[[HasType::{{#if:{{{HasType|}}}|{{{HasType}}}|PublicFigure}}]]}} | |||
{{#if:{{{HasName|}}}|[[HasName::{{{HasName}}}]]}} | {{#if:{{{HasName|}}}|[[HasName::{{{HasName}}}]]}} | ||
{{#if:{{{ | {{#if:{{{HasAltName|}}}|[[HasAltName::{{{HasAltName}}}]]}} | ||
{{#if:{{{HasHebName|}}}|[[HasHebName::{{{HasHebName}}}]]}} | {{#if:{{{HasHebName|}}}|[[HasHebName::{{{HasHebName}}}]]}} | ||
{{#if:{{{HasYiddishName|}}}|[[HasYiddishName::{{{HasYiddishName}}}]]}} | {{#if:{{{HasYiddishName|}}}|[[HasYiddishName::{{{HasYiddishName}}}]]}} | ||
| Line 23: | Line 24: | ||
{{#if:{{{HasArticle|}}}|[[HasArticle::{{{HasArticle}}}]]}} | {{#if:{{{HasArticle|}}}|[[HasArticle::{{{HasArticle}}}]]}} | ||
{{#if:{{{HasProfession|}}}|[[HasProfession::{{{HasProfession}}}]]}} | {{#if:{{{HasProfession|}}}|[[HasProfession::{{{HasProfession}}}]]}} | ||
{{#if:{{{HasURL|}}}|[[HasURL::{{{HasURL}}}]]}} | {{#if:{{{HasURL|}}}|[[HasURL::{{{HasURL}}}]]}} | ||
<!--Take the value of HasURL, split it at every semicolon (;), and create one [[HasURL::URL]] triple per item --> | <!--Take the value of HasURL, split it at every semicolon (;), and create one [[HasURL::URL]] triple per item --> | ||
{{# | <!-- {{#arraymap:{{{HasURL|}}}|;|@@|[[HasURL::@@]]|}} --> | ||
<!-- Multiple URLs separated by semicolon: validate each before storing --> | |||
{{#arraymap:{{{HasURL|}}}|;|@@| | |||
{{#if: {{#rmatch:@@|^https?://}} | | |||
[[HasURL::@@]] <!-- valid, stored --> | |||
| | |||
<!-- invalid, not stored --> | |||
}} | |||
}} | |||
</div> | </div> | ||
| Line 55: | Line 67: | ||
{{#if:{{{HasVIAFID|}}}|'''VIAF ID:''' {{{HasVIAFID}}}<br/>}} | {{#if:{{{HasVIAFID|}}}|'''VIAF ID:''' {{{HasVIAFID}}}<br/>}} | ||
<!-- {{#if:{{{HasURL|}}}|'''External link:''' [{{{HasURL}}} link]<br/>}} --> | <!-- {{#if:{{{HasURL|}}}|'''External link:''' [{{{HasURL}}} link]<br/>}} --> | ||
<!-- {{#if:{{{HasURL|}}}| --> | |||
<!-- '''External links:''' --> | |||
<!-- {{#arraymap:{{{HasURL}}}|;|@@|[@@ link]|<br/>}}<br/> --> | |||
<!-- }} --> | |||
<!-- External links with validation --> | |||
{{#if:{{{HasURL|}}}| | {{#if:{{{HasURL|}}}| | ||
'''External links:''' | '''External links:'''<br/> | ||
{{#arraymap:{{{HasURL}}}|;|@@|[@@ link] | |||
<!-- Print valid URLs as links --> | |||
{{#arraymap:{{{HasURL}}}|;|@@| | |||
{{#if: {{#rmatch:@@|^https?://}} | | |||
[@@ link]<br/> | |||
| | |||
<!-- Do not show invalid URLs here --> | |||
}} | |||
}} | |||
<!-- List invalid URLs --> | |||
{{#arraymap:{{{HasURL}}}|;|@@| | |||
{{#if: {{#rmatch:@@|^https?://}} | | |||
<!-- valid; do nothing --> | |||
| | |||
<span style="color:red; font-size:90%;">Invalid URL ignored: @@</span><br/> | |||
}} | |||
}} | |||
}} | }} | ||
</div> | </div> | ||
</includeonly> | </includeonly> | ||
Revision as of 14:10, 27 November 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=File:Jacob_ben_Moses.jpg
|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
}}