Jump to content

ᥗᥦᥛᥰ ᥙᥣ ᥘᥥᥐᥳ:Formatter link/doc

ᥘᥧᥐ ᥖᥤ ᥝᥤᥱ ᥑᥤᥱ ᥚᥤᥱ ᥖᥤᥱ ᥕᥣᥱ ᥛᥣᥰ

Wikidata contains many examples of "External identifiers" such as ATC code (P267) – see Anatomical Therapeutic Chemical Classification System.

These codes are used with formatter 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.

ᥖᥨᥝᥴᥕᥣᥒᥱ

[ᥛᥥᥰ ᥗᥖᥴ ᥒᥝᥲ ᥒᥣᥱ]

For aluminium acetoacetate (Q26979), ATC code (P267):

The formatter url to use for ATC code (P267) can be found from:

  • {{wdib |P1630 |qid=P267 |fwd=ALL |osd=n}}Lua error in ᥛᥨᥝᥱ_ᥓᥧᥰ:Deprecated at line 18: assign to undeclared variable 'warn'.

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}} }}

Combines a Wikidata “formatter URL (P1630)” with an id code to produce a URL

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
codecode

the unique ID value of the target page

Unknownrequired
urlurl

the Wikidata “formatter URL (P1630)”

Unknownrequired
labellabel

the text of the link (defaults to the value of “code”)

Unknownoptional