Redigerer
Mal:Wikidata/dok
(avsnitt)
Hopp til navigering
Hopp til søk
Advarsel:
Du er ikke innlogget. IP-adressen din vil bli vist offentlig om du redigerer. Hvis du
logger inn
eller
oppretter en konto
vil redigeringene dine tilskrives brukernavnet ditt, og du vil få flere andre fordeler.
Antispamsjekk.
Ikke
fyll inn dette feltet!
== Usage == The general structure of a call to this {{lcfirst:{{NAMESPACE}}}} is as follows. Note that the basic structure consists of positional commands, flags and arguments, which all have a fixed position. :{{tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}{{0| }}{{Background color|#cddae3|<nowiki>|command1|flag1a|flag1b|flag1c</nowiki>}}{{0| }}{{Background color|#dce5ec|<nowiki>|command2|flag2a|flag2b|flag2c</nowiki>}}{{0| }}{{Background color|#c1debf|<nowiki>|flag0a|flag0b|flag0c</nowiki>}}{{0| }}{{Background color|#ffdfc4|<nowiki>|arg1|arg2|arg3</nowiki>}}}} Use different [[#Commands|{{Background color|#cddae3|commands}}]] to get different kinds of values from Wikidata. At least one command must be given and multiple commands can be combined into one call as shown above (in any order, more than two is also possible), but this only applies to commands from the [[#Claim class|claim class]]; calls containing a command from the [[#General class|general class]] cannot contain any other command. Each command can be followed by any number of [[#Command flags|{{Background color|#cddae3|command flags}}]], which are optional and can be used to tweak the output generated by that command. The commands and their flags may be followed by any number of [[#Configuration flags|{{Background color|#c1debf|configuration flags}}]], which are also optional and affect the selection of data and the {{lcfirst:{{NAMESPACE}}}}'s behaviour in general. The call is closed with the [[#Positional arguments|{{Background color|#ffdfc4|positional arguments}}]], which may be required depending on the given command(s). Some [[#Named arguments|named arguments]] (i.e. name-value pairs) also exist, as well as a set of named flags for [[#Advanced usage|advanced usage]] that can be used to change the way the fetched values are merged together into the output. This {{lcfirst:{{NAMESPACE}}}} was designed to provide the basic needs for fetching data from Wikidata, but a lot can be achieved through different combinations of calls. For convenience, such combinations could be wrapped into new templates that serve a specific need. See also the section on [[#Common use cases|common use cases]] below for some examples of useful "building blocks". Likewise, the functionality of this {{lcfirst:{{NAMESPACE}}}} can be extended by creating wrapper templates that use the [[Module:Wd#Main class|<code>main</code> command]] provided by {{module other|this module|[[Module:Wd]] which is being used by this template}} (just like {{t|WikidataOI}} does). === Common use cases === Below follows a list of common use cases. In the future, shortcut commands may be implemented that are equivalent to these calls for convenience. {| class="wikitable" |- ! Call ! Use case |- | {{nowrap|{{tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|label|raw|{{{extraparams|}}}}}}} | Returns the Q-identifier of the Wikidata item connected to the current page (e.g. "Q55"). |- | {{nowrap|<code><nowiki>{{#if:</nowiki>{{tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|label|raw|{{{extraparams|}}}}}<nowiki>|...}}</nowiki></code>}} | Performs a check to determine if the current page has a Wikidata item. Note that this statement relies on a returned value that is either empty or non-empty and that the <code>raw</code> flag is important to include. Without this flag, an existing item's regular label would be returned which could be empty, giving an undesired result. If the flag is given on the other hand, then a non-empty Q-identifier is always returned if an item exists and an empty value if an item does not exist. |}
Redigeringsforklaring:
Merk at alle bidrag til Wikisida.no anses som frigitt under Creative Commons Navngivelse-DelPåSammeVilkår (se
Wikisida.no:Opphavsrett
for detaljer). Om du ikke vil at ditt materiale skal kunne redigeres og distribueres fritt må du ikke lagre det her.
Du lover oss også at du har skrevet teksten selv, eller kopiert den fra en kilde i offentlig eie eller en annen fri ressurs.
Ikke lagre opphavsrettsbeskyttet materiale uten tillatelse!
Avbryt
Redigeringshjelp
(åpnes i et nytt vindu)
Forhåndsvis en side som bruker denne malen
Navigasjonsmeny
Personlige verktøy
Ikke logget inn
Brukerdiskusjon
Bidrag
Opprett konto
Logg inn
Navnerom
Mal
Diskusjon
norsk bokmål
Visninger
Les
Rediger kilde
Vis historikk
Mer
Navigasjon
Forside
Siste endringer
Tilfeldig side
Hjelp til MediaWiki
Verktøy
Lenker hit
Relaterte endringer
Spesialsider
Sideinformasjon