Hoppa till innehållet

Modul:Comcat

Från Wikipedia

Dokumentationen för denna modul kan skapas på Modul:Comcat/dok

local p = {}

function p.com( frame )
	local pFrame = frame:getParent()
	if pFrame.args['commons'] then
		return pFrame.args['commons']
	end
	
	local entity = mw.wikibase.getEntityObject()
	local comcat = ''
	if not entity or not entity.claims or not entity.claims.P373 then
		return ''
	else
		if entity.claims.P373[1].mainsnak.snaktype ~= 'value' then
			return ''
		else
			comcat = entity.claims.P373[1].mainsnak.datavalue.value
		end
	end
	return comcat
end

return p