For faster navigation, this Iframe is preloading the Wikiwand page for Module:Image Wikidata.

Module:Image Wikidata

 Documentation[créer] [purger]
local p = {}
local wd = require "Module:Wikidata"

function p.main(frame) -- mêmes arguments que Wikidata + argument "info", mettre "image" pour avoir le nom du fichier et "légende" pour avoir la légende
	local infotype = frame.args.info
	local args = frame:getParent().args
	local localdata = args[1] and mw.text.trim(args[1]) or nil -- si des données sont fournies localement, les utiliser plutôt que les données de Wikidata
	if localdata and (localdata ~= "") then
		if localdata == "-" then
			return nil
		else
			return localdata
		end
	end
	args.numval = 1
	if (not args.property) or (args.property == "") then
		args.property = "P18"
	end
	local claims = wd.getClaims(args)
	if not claims then
		return nil
	end
	local claim = claims[1]
	if infotype == "image" then
		return wd.formatStatement(claim, args)
	end
	if infotype == "légende" then
		local captions = wd.getQualifiers(claim, {"P2096"}, args)
		if not captions then
			return nil
		end
		for i, j in pairs(captions) do
			if j.datavalue.value and (j.datavalue.value.language == (args.lang or "fr")) then
				return wd.formatSnak(j, args)
			end
		end
	end
end

return p
{{bottomLinkPreText}} {{bottomLinkText}}
Module:Image Wikidata
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?