Module:NAMESPACEID

From The Sims Wiki, a collaborative database for The Sims series
This is the current revision of this page, as edited by K6ka (talk | contribs) at 23:41, 14 March 2019 (copy from wikipedia:Module:NAMESPACEID). The present address (URL) is a permanent link to this version.
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:NAMESPACEID/doc

-- This module implements {{NAMESPACEID}}.

local p = {}

function p.main(frame)
	local ns = frame:getParent().args[1] or mw.title.getCurrentTitle().namespace
	local nsTable = mw.site.namespaces[ns]
	if nsTable then
		return nsTable.id
	else
		return '<strong class="error">Invalid namespace in ' ..
		'&#123;&#123;[[Template:NAMESPACEID|NAMESPACEID]]&#125;&#125;</strong>'
	end
end

return p