Personal notes on useful templates and examples

Help:A_quick_guide_to_templates functions that generate wiki markdown content. By default, templates are transclusive so you'll see the template used rather than the compiled text. It has syntax of {{some_function}}. To use it with substitution (i.e. permanently create text at publish time, such as {{subst:some_function}}. A real example would be {{subst:Uw-plagiarism}} which can be found on Template:Uw-plagiarism. A common example would be signing posts with ~~~~. Templates are platform specific, and can accept arguments. Templates can be nested.

Personal use cases

edit

Markup and compiled result

edit

This substituted Mra code {{subst:Mra|{{ill|Jüdische Rundschau|de|Jüdische Rundschau|he|יידישה רונדשאו}}}} produces what you see in immediate section below.

edit

English wikilink with German and Hebrew interlanguage links in this edit

Markup Renders as
{{ill|Jüdische Rundschau|de|Jüdische Rundschau|he|יידישה רונדשאו}}

Nested infoboxes

edit

Note the param module, and embed=yes. Used in this edit

Markup Renders as
{{Infobox person
 | image          = Uri Avneri 1965-11-01 (cropped).jpg
 | caption        = Avnery in 1965
 | birth_name     = '''Helmut Ostermann'''
 | birth_date     = {{Birth date|df=y|1923|9|10|}}
 | birth_place    = [[Beckum, Germany|Beckum]], Germany
 | death_date     = {{death date and age|df=y|2018|8|20|1923|9|10|}}
 | death_place    = [[Tel Aviv]], [[Israel]]
 |module            = {{Infobox member of the Knesset
   |embed           = yes
   | Year of Aliyah = 1933
   | Knesset(s)     = [[Israeli legislative election, 1965|6]], [[Israeli legislative election, 1969|7]], [[Israeli legislative election, 1977|9]]
   | party1         = [[Meri (political party)|Meri]]
   | partyyears1    = 1965–1974
   | party2         = [[Left Camp of Israel]]
   | partyyears2    = 1979–1981
  }}
}}
Shushugah/documentation
 
Avnery in 1965
Born
Helmut Ostermann

(1923-09-10)10 September 1923
Beckum, Germany
Died20 August 2018(2018-08-20) (aged 94)
{{Infobox member of the Knesset |embed = yes | Year of Aliyah = 1933 | Knesset(s) = [[Israeli legislative election, 1965|6]], [[Israeli legislative election, 1969|7]], [[Israeli legislative election, 1977|9]] | party1 = [[Meri (political party)|Meri]] | partyyears1 = 1965–1974 | party2 = [[Left Camp of Israel]] | partyyears2 = 1979–1981 }}

Using Wikidata

edit

Wikidata is exciting, because it has potential to replace or compliment the manual updating of infoboxes with structured data. As a live demo, I emptied out most of the attributes below, such as birth and death dates. Note the image changed too. As off this publication, the death_dates were not sourced on wikidata, so they do not appear here. For non biography (or no BLP?), you can use onlysourced=false param, to include everything. You can whitelist or blacklist specific params if needed.

The documentation for Template:Infobox_person/Wikidata/sandbox was incomplete and confusing. So far I understand that the params qid and fetchwikidata are required. Embedded Wikidatas is my next challenge to figure out.

Markup Renders as
{{Infobox person/Wikidata
 | qid = Q325679
 | fetchwikidata = ALL
 | onlysourced   = yes 
 | image         = 
 | caption       = 
 | birth_name    = 
 | birth_date    = 
 | birth_place   = 
 | spouse        = 
 |module            = {{Infobox member of the Knesset
   |embed           = yes
   | Year of Aliyah = 1933
   | Knesset(s)     = [[Israeli legislative election, 1965|6]], [[Israeli legislative election, 1969|7]], [[Israeli legislative election, 1977|9]]
   | party1         = [[Meri (political party)|Meri]]
   | partyyears1    = 1965–1974
   | party2         = [[Left Camp of Israel]]
   | partyyears2    = 1979–1981
  }}
}}
Shushugah/documentation
 
Born10 September 1923  
Died20 August 2018   (aged 94)
Spouse(s)Rachel Avnery  
Websitehttp://uriavnery.com  
{{Infobox member of the Knesset |embed = yes | Year of Aliyah = 1933 | Knesset(s) = [[Israeli legislative election, 1965|6]], [[Israeli legislative election, 1969|7]], [[Israeli legislative election, 1977|9]] | party1 = [[Meri (political party)|Meri]] | partyyears1 = 1965–1974 | party2 = [[Left Camp of Israel]] | partyyears2 = 1979–1981 }}
Position heldMember of Knesset (1965–1969), Member of Knesset (1979–1981)  

A convenient javascript function to extract coordinates from console of a Google maps web page in nearly any browser for the Coordinate values in the Infobox;

(function () { var matches = location.toString().match("\/maps\/.*@([0-9.-]+),([0-9.-]+)"); prompt('',"{{coord|" + matches[1] + "|" +   matches[2] + "}}"); }());

Gadgets and tools

edit