<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AGet_QID%2Fdoc</id>
	<title>Template:Get QID/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AGet_QID%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Template:Get_QID/doc&amp;action=history"/>
	<updated>2026-05-30T05:10:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Template:Get_QID/doc&amp;diff=36725&amp;oldid=prev</id>
		<title>imported&gt;Sdkb: /* See also */ add inverse</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Template:Get_QID/doc&amp;diff=36725&amp;oldid=prev"/>
		<updated>2023-01-10T07:48:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See also: &lt;/span&gt; add inverse&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;!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
This template retrieves the [[WP:Wikidata|Wikidata]] QID that corresponds to the &amp;#039;&amp;#039;Wikipedia page title&amp;#039;&amp;#039; or &amp;#039;&amp;#039;redirection page title&amp;#039;&amp;#039; specified in the first unnamed parameter (also known as &amp;#039;&amp;#039;Wikipedia sitelink&amp;#039;&amp;#039;, not to be confused with the Wikidata label). If a page is moved, a {{tlp|Get QID|&amp;lt;page title&amp;gt;}} call referring to its former title typically still works, since the template follows the redirection destination, if the redirection source does not have a Wikidata item of its own. If no parameter is defined ({{tlp|Get QID}}), it retrieves the QID of the current page. If the qid parameter is defined ({{tlp|get QID|qid=&amp;lt;QID&amp;gt;}}) it just passes it on.&lt;br /&gt;
&lt;br /&gt;
===Current page===&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Get QID}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{Get QID}}&lt;br /&gt;
gives the QID of the currently showed Wikipedia page, or an empty text string if no QID is defined:&lt;br /&gt;
&lt;br /&gt;
===Articles sharing the same label===&lt;br /&gt;
The template does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; use the Wikidata label, but the Wikipedia page title. For example, the following two pages share the same Wikidata label &amp;#039;&amp;#039;Mars&amp;#039;&amp;#039;:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Get QID|Mars}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{Get QID|Mars}}&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Get QID|Mars (mythology)}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{Get QID|Mars (mythology)}}&lt;br /&gt;
This gives the QID:s of [[Mars (planet)]] and [[Mars (mythology)]] respectively.&lt;br /&gt;
&lt;br /&gt;
===Redirection page===&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Get QID|universes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{Get QID|universes}}&lt;br /&gt;
gives the QID of the page [[universe]], since [[universes]] is redirected to that article, and does not have a Wikidata item of its own.&lt;br /&gt;
&lt;br /&gt;
Usage together with the Q template: &lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Q|{{Get QID|universes}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;  &amp;amp;rarr; {{Q|{{Get QID|universes}}}}&lt;br /&gt;
&lt;br /&gt;
===Redirection page with its own Wikidata item===&lt;br /&gt;
[[Maryport New Lighthouse]] is redirected to [[Maryport Lighthouse]], both having separate Wikidata items:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Q|{{Get QID|Maryport New Lighthouse}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{Q|{{Get QID|Maryport New Lighthouse}}}}&lt;br /&gt;
&lt;br /&gt;
===Passing QID parameter on===&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Get QID|qid=Q111}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{Get QID|qid=Q111}}&lt;br /&gt;
&lt;br /&gt;
===Substitution===&lt;br /&gt;
To make Wikipedia faster, and to make the result less vulnerable to future deletion of redirects, this template may be substituted: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{subst:Get QID|&amp;lt;page title&amp;gt;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, for example:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{subst:Get QID|universe}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; Q1 &lt;br /&gt;
which is immediately replaced by the resulting QID when saved.&lt;br /&gt;
 &lt;br /&gt;
However, a purpose of this template is to make the wikicode more comprehensible by avoiding QID codes, which substitution counteracts.&lt;br /&gt;
&lt;br /&gt;
===Other ways of getting the QID===&lt;br /&gt;
Invoking these modules may also provide the QID for a certain Wikipedia page title:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:wd|label|raw|page=Mars (mythology)}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:wd|label|raw|page=Mars (mythology)}}&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:WikidataIB|getEntityFromTitle|Mars (mythology)}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:WikidataIB|getEntityFromTitle|Mars (mythology)}}&lt;br /&gt;
but they do not follow redirects.&lt;br /&gt;
&lt;br /&gt;
The following module provides the page title of a redirect destination:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Redirect|main|Universes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; {{#invoke:Redirect|main|Universes}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{tl|Area WD}}&lt;br /&gt;
* {{tl|Population WD}}&lt;br /&gt;
* {{tl|Popdens WD}}&lt;br /&gt;
* {{tl|Label}}, the inverse template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line; 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>imported&gt;Sdkb</name></author>
	</entry>
</feed>