Module:CommonsSitelink

Uit Wiki Raamsdonks Historie

--[[
Simple module to get the sitelink to Commons for the current page

{{#Invoke:CommonsSitelink | commonsSitelink }}

]]

local p = {}
 
-- Return title of the page at Commons linked to this page.
function p.commonsSitelink(frame)
	globalFrame = frame
	local args = frame.args
	local entity = mw.wikibase.getEntityObject()
	if entity and entity.sitelinks and entity.sitelinks.commonswiki then
		return entity.sitelinks.commonswiki.title
	else
		return ''
	end
end

return p