Semantic MediaWikiDit bericht verdwijnt nadat alle relevante taken zijn afgerond.

Er is één onvoltooide of openstaande taak, die nodig is om het bijwerken van Semantic MediaWiki te voltooien. Een beheerder of gebruiker met voldoende rechten kan deze uitvoeren. Dit moet worden gedaan voordat nieuwe gegevens worden toegevoegd om tegenstrijdigheden te voorkomen.

Geen bewerkingssamenvatting
Geen bewerkingssamenvatting
Regel 3: Regel 3:
--[[
--[[
test test
test test
{{#invoke:Award category |main |json={{#slot:ws-data|{{FULLPAGENAME}} }} }}
{{#invoke:Award category |main |json={{#slot:ws-data|{{FULLPAGENAME}}}} }}


]]--
]]--
Regel 9: Regel 9:
local json = frame.args['json']
local json = frame.args['json']
local output = json
local output = json
return output
if output ~= nil then
return output
else
return ""
end
end
end



Versie van 29 dec 2024 13:13

Module:Award category




local p = {}

--[[
test test
{{#invoke:Award category |main |json={{#slot:ws-data|{{FULLPAGENAME}}}} }}

]]--
function p.main ( frame )
	local json = frame.args['json']
	local output = json
	if output ~= nil then
		return output
	else
		return ""
	end
end

--[[
Store in SMW
Consider using Lua version of parser function instead

{{#invoke:Award category
|store
|json={{#slot:ws-data|{{FULLPAGENAME}} }}
}}

]]--
function p.store( frame )
	local json = frame.args['json'] or nil
	if json == nil or json == "" then
		--Fail silently
		return
	end
	--etc etc
	
	-- #set
	
	-- #subobjects
	local awardInstances = json["Awards"] or nil
	if awardInstances ~= nil then
		for i, v in ipairs( awardInstances ) do
			local test = store_award_as_subobject( frame, v )
		end
	end
	
end

--[[
Local helper function for p.store
Stores each instance in a subobject
]]--
local function store_award_as_subobject( frame, args )
	-- local item = args?
	local rankArg = args["Rank"] or nil
	local typeArg = args["Type"] or nil
	local categorieArg = args["Categorie"] or nil
	local titleArg = args["Title"] or nil
	local descriptionArg = args["Description"] or nil
	
	if mw.smw then
		local subobjectTable = {}
		--etc
	end
end

local function send_to_template( frame, templateName, argsTable )
	if templateName ~= nil and argsTable ~= nil then
		return frame:expandTemplate{ title = templateName, args = argsTable }
	else
		return ""
	end
end