Cèṭa'an:Formatter link/doc
TemplateStyles' src
attribute must not be empty.
This is a documentation subpage for Cèṭa'an:Formatter link. It contains usage information, categories and other content that is not part of the original cèṭa'an page. |
Wikidata contains many examples of "External identifiers" such as kode ATC (P267) – see Anatomical Therapeutic Chemical Classification System.
These codes are used with pemformat URL (P1630) such as http://www.whocc.no/atc_ddd_index/?code=$1 where the $1 is to be substituted by the ATC code.
This template takes an external identifier code as |code=
and uses a formatter url as |url=
to construct a link to the external resource; an optional |label=
parameter sets the text of the link, defaulting to the value of |code=
otherwise.
Supplying the code as a parameter to this template allows one call to be made to Wikidata to fetch the code.
Example
[beccè' sombher]For aluminium acetoacetate (Q26979), kode ATC (P267):
{{Formatter link |url=http://www.whocc.no/atc_ddd_index/?code=$1 |code={{wdib |P267 |qid=Q26979 |fwd=ALL |osd=n |noicon=y |maxvals=1}} }}
→ Lua error in Modul:WikidataIB at line 94: attempt to call field 'loadI18n' (a nil value). Lua error in Modul:WikidataIB at line 94: attempt to call field 'loadI18n' (a nil value).
The formatter url to use for kode ATC (P267) can be found from:
{{wdib |P1630 |qid=P267 |fwd=ALL |osd=n}}
→ Lua error in Modul:WikidataIB at line 94: attempt to call field 'loadI18n' (a nil value).
In infoboxes, it will generally be hard-coded because it is specific to the infobox field. Otherwise the following can be used if Wikidata changes of the formatter url should be tracked:
{{Formatter link |url={{wdib |P1630 |qid=P267 |fwd=ALL |osd=n |noicon=y}} |code={{wdib |P267 |qid=Q26979 |fwd=ALL |osd=n |noicon=y |maxvals=1}} }}
See also
[beccè' sombher]- {{Wikidata ID}} and {{Wikidata ID line}}
- {{format link}}, a similarly-named but completely unrelated template
Template data
[beccè' sombher]Combines a Wikidata “formatter URL (P1630)” with an id code to produce a URL
Parameter | Keterangan | Jenis | Status | |
---|---|---|---|---|
code | code | the unique ID value of the target page | Tak dikenal | wajib diisi |
url | url | the Wikidata “formatter URL (P1630)” | Tak dikenal | wajib diisi |
label | label | the text of the link (defaults to the value of “code”) | Tak dikenal | opsional |