<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pttlink.org/index.php?action=history&amp;feed=atom&amp;title=Template%3AFormatter_link%2Fdoc</id>
	<title>Template:Formatter link/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pttlink.org/index.php?action=history&amp;feed=atom&amp;title=Template%3AFormatter_link%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Template:Formatter_link/doc&amp;action=history"/>
	<updated>2026-04-30T00:50:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://wiki.pttlink.org/index.php?title=Template:Formatter_link/doc&amp;diff=5938&amp;oldid=prev</id>
		<title>Kg7qin: Created page with &quot;{{Documentation subpage}} &lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --&gt; Wikidata contains...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Template:Formatter_link/doc&amp;diff=5938&amp;oldid=prev"/>
		<updated>2022-01-20T23:11:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Documentation subpage}} &amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Wikidata&quot; class=&quot;extiw&quot; title=&quot;wikipedia:Wikidata&quot;&gt;Wikipedia:Wikidata&lt;/a&gt;) --&amp;gt; Wikidata contains...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
Wikidata contains many examples of &amp;quot;External identifiers&amp;quot; such as {{q|P267}} – see [[Anatomical Therapeutic Chemical Classification System]].&lt;br /&gt;
&lt;br /&gt;
These codes are used with {{q|P1630}} such as http://www.whocc.no/atc_ddd_index/?code=$1 where the $1 is to be substituted by the ATC code.&lt;br /&gt;
&lt;br /&gt;
This template takes an external identifier code as {{para|code}} and uses a formatter url as {{para|url}} to construct a link to the external resource; an optional {{para|label}} parameter sets the text of the link, defaulting to the value of {{para|code}} otherwise.&lt;br /&gt;
&lt;br /&gt;
Supplying the code as a parameter to this template allows one call to be made to Wikidata to fetch the code.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
For {{q|Q26979}}, {{q|P267}}:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{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}} }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{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}} }}&lt;br /&gt;
&lt;br /&gt;
The formatter url to use for {{q|P267}} can be found from:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{wdib |P1630 |qid=P267 |fwd=ALL |osd=n}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{wdib |P1630 |qid=P267 |fwd=ALL |osd=n}}&lt;br /&gt;
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:&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{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}} }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{tl|Wikidata ID}} and {{tl|Wikidata ID line}}&lt;br /&gt;
* {{tl|format link}}, a similarly-named but completely unrelated template&lt;br /&gt;
&lt;br /&gt;
==Template data==&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;code&amp;quot;: {&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;the unique ID value of the target page&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;url&amp;quot;: {&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;the Wikidata “formatter URL (P1630)”&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;label&amp;quot;: {&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;the text of the link (defaults to the value of “code”)&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;description&amp;quot;: &amp;quot;Combines a Wikidata “formatter URL (P1630)” with an id code to produce a URL&amp;quot;,&lt;br /&gt;
	&amp;quot;format&amp;quot;: &amp;quot;inline&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Wikidata templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kg7qin</name></author>
	</entry>
</feed>