User:Shushugah/documentation
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
. To use it with substitution (i.e. permanently create text at publish time, such as
. A real example would be
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
= Markup and compiled result =
This substituted Mra code
produces what you see in immediate section below.
= Interlanguage Links =
English wikilink with German and Hebrew interlanguage links in this {{diff2|856207111|edit}}
{{markup|
= Nested infoboxes =
Note the param module, and embed=yes. Used in this {{Diff2|857482857|edit}}
{{markup|
| 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
| 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
| party1 = Meri
| partyyears1 = 1965–1974
| party2 = Left Camp of Israel
| partyyears2 = 1979–1981
}}
}}|{{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
| death_date = {{death date and age|df=y|2018|8|20|1923|9|10|}}
| death_place = Tel Aviv, Israel
|module =
|embed = yes
| Year of Aliyah = 1933
| party1 = Meri
| partyyears1 = 1965–1974
| party2 = Left Camp of Israel
| partyyears2 = 1979–1981
}}
}}}}
= Using Wikidata =
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|
| 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
| party1 = Meri
| partyyears1 = 1965–1974
| party2 = Left Camp of Israel
| partyyears2 = 1979–1981
}}
}}|{{Infobox person/Wikidata
| qid = Q325679
| fetchwikidata = ALL
| onlysourced = yes
| image =
| caption =
| birth_name =
| birth_date =
| birth_place =
| spouse =
|module =
|embed = yes
| Year of Aliyah = 1933
| party1 = Meri
| partyyears1 = 1965–1974
| party2 = Left Camp of Israel
| partyyears2 = 1979–1981
}}
}}}}
= [[Template:Coord]] =
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
- Trying to update publications with a wikidata author item? Use https://author-disambiguator.toolforge.org/ which I made extensive use of in Paul Brombacher's dozens of publications.