Jump to content

Module:Sandbox/BrandonXLF/4

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 05:06, 21 February 2023 (Allow sandbox). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- Sandbox, do not delete
local config = require('Module:Authority control/config').config
local p = {}

function p.main(frame)
	local args = { state = frame.args.state }
	local template = frame.args.sandbox and 'Template:Authority control/sandbox' or 'Template:Authority control'
	
	for _, conf in pairs(config) do
		local statement = mw.wikibase.getBestStatements('P'..conf.property, 'P1855')[1]
		
		if statement then
			args[conf[1]] = statement.qualifiers['P' .. conf.property][1].datavalue.value
		end
	end
	
	local newParentFrame = frame:newChild{ title = 'Foo', args = args }
	local newFrame = newParentFrame:newChild{ title = template, args = {} }
	
	return require('Module:Suppress categories').main( ac.authorityControl( newFrame ) )
end

return p