टेम्पलेट:Get QID
Q26090228
Usage
[संपादन करीं]This template retrieves the Wikidata QID that corresponds to the Wikipedia page title or redirection page title specified in the first unnamed parameter (also known as Wikipedia sitelink, not to be confused with the Wikidata label). If a page is moved, a {{Get QID|<page title>}} 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 ({{Get QID}}), it retrieves the QID of the current page. If the qid parameter is defined ({{get QID}}) it just passes it on.
Current page
[संपादन करीं]Example:
{{Get QID}}
→ Q26090228
gives the QID of the currently showed Wikipedia page, or an empty text string if no QID is defined:
Articles sharing the same label
[संपादन करीं]The template does not use the Wikidata label, but the Wikipedia page title. For example, the following two pages share the same Wikidata label Mars:
{{Get QID|Mars}}
→{{Get QID|Mars (mythology)}}
→
This gives the QID:s of Mars (planet) and Mars (mythology) respectively.
Redirection page
[संपादन करीं]{{Get QID|universes}}
→
gives the QID of the page universe, since universes is redirected to that article, and does not have a Wikidata item of its own.
Usage together with the Q template:
{{Q|{{Get QID|universes}}}}
→ टेम्पलेट:Get QID (Q26090228)
Redirection page with its own Wikidata item
[संपादन करीं]Maryport New Lighthouse is redirected to Maryport Lighthouse, both having separate Wikidata items:
{{Q|{{Get QID|Maryport New Lighthouse}}}}
→ टेम्पलेट:Get QID (Q26090228)
Passing QID parameter on
[संपादन करीं]{{Get QID|qid=Q111}}
→ Q111
Substitution
[संपादन करीं]To make Wikipedia faster, and to make the result less vulnerable to future deletion of redirects, this template may be substituted: {{subst:Get QID|<page title>}}
, for example:
{{subst:Get QID|universe}}
→ Q1
which is immediately replaced by the resulting QID when saved.
However, a purpose of this template is to make the wikicode more comprehensible by avoiding QID codes, which substitution counteracts.
Other ways of getting the QID
[संपादन करीं]Invoking these modules may also provide the QID for a certain Wikipedia page title:
{{#invoke:wd|label|raw|page=Mars (mythology)}}
→{{#invoke:WikidataIB|getEntityFromTitle|Mars (mythology)}}
→
but they do not follow redirects.
The following module provides the page title of a redirect destination:
{{#invoke:Redirect|main|Universes}}
→ Universes
See also
[संपादन करीं]- {{Area WD}}
- {{Population WD}}
- {{Popdens WD}}
- {{Label}}, the inverse template
परिचय खातिर ऊपर दिहल गइल बिबरनलेख के टेम्पलेट:Get QID/doc से ट्रांसक्लूड क के इहाँ देखावल जा रहल बाटे। (संपादन करीं | इतिहास देखीं) संपादक लोग एह टेम्पलेट के अभ्यासपन्ना (सैंडबाक्स) (बनाईं | मिरर करीं) आ टेस्टकेस (बनाईं) पन्ना सभ पर अभ्यास आ प्रयोग (टेस्टिंग) क सकत बाटे। अनुरोध बा कि अगर श्रेणी जोड़े के होखे तब /doc उपपन्ना (सबपेज) पर जोड़ल जाय। एह टेम्पलेट के उपपन्ना (सबपेज) देखीं। |