-- This is the code to insert a template to indicate that the link is in English:
-- frame:expandTemplate{ title = "LANGUAGETEMPLATENAME", args = { "en" } }
-- It is obviously not used in the English Wikipedia itself.
local function linktext(s)
	entity = mw.wikibase.getEntityObject()
	if not entity then
		label = mw.title.getCurrentTitle().text
		label = mw.wikibase.label( or mw.title.getCurrentTitle().text
	if (s == nil) or (s == "") then
		-- This text returns an error that says that the Sports Reference ID is neither
		-- present on Wikidata nor in the article, and categorises the page as missing
		-- the Wikidata property.
		return "<span class='error'>Sports Reference ID is neither present in Wikidata nor the article!</span> \
		[[Template:Sports-reference#Add ID in Wikidata|How do I fix this?]]\
		[[Category:Sports Reference not on Wikidata]]"
		-- This is the text that is returned if there is a Sports Reference ID on Wikidata or in the article.
		return "[" .. s .. ".html " .. label .. "] at [[Sports Reference]]"
local p = {}
	-- This is a check to see if the optional first parameter contains ".html". If it does, remove it.
	id = string.gsub((frame.args[1] or ""), ".html", "")
	if not mw.wikibase then
		return linktext(id)
	local entity = mw.wikibase.getEntityObject()
	if not entity then
		-- This is the place to insert a category for articles that don't have items in Wikidata.
		-- enwiki doesn't seem to have such a category, so in this case it is empty.
		-- For other wikis, just remove the two comment dashes and insert the correct category name.
		return linktext(id) -- .. "[[Category:Articles without Wikidata item]]"
	local claims = or {}
	local hasProp = claims["P1447"]
	if not hasProp then
		-- Category for articles that don't have the Sports Reference property on Wikidata.
		return linktext(id) .. "[[Category:Sports Reference not on Wikidata]]"
	local propValue = hasProp[1].mainsnak.datavalue.value
	return linktext(propValue)
return p

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.