Geen bewerkingssamenvatting
Geen bewerkingssamenvatting
Regel 14: Regel 14:
     local slotData = {}
     local slotData = {}
     slotData = mw.slots.slotData(slot,page)
     slotData = mw.slots.slotData(slot,page)
    if slotData == {} then mw.log( "No slot data found" ) end
local template = frame.args.template or nil
local template = frame.args.template or nil
if template == nil then return "" end
local param = frame.args.param or ""
local param = frame.args.param or ""
if slotData == {} then mw.log( "No slot data found" ) end
for k,v in pairs( slotData ) do
mw.log( k )  
end


local res = ""
local res = ""

Versie van 4 sep 2025 09:02

Documentatie voor deze module kan aangemaakt worden op de volgende pagina: Module:Slot/doc

local p = {}

--[[
{{#invoke:Slot|getParamValue
|slot= // defaults to main
|page= // defaults to FULLPAGENAME
|template=
|param=
]]--
p.getParamValue = function ( frame )
	local slot = frame.args.slot or "main"
	local page = frame.args.page or ""
	if page == "" then page = mw.title.getCurrentTitle().fullText end
    local slotData = {}
    slotData = mw.slots.slotData(slot,page)
    if slotData == {} then mw.log( "No slot data found" ) end
	local template = frame.args.template or nil
	if template == nil then return "" end
	local param = frame.args.param or ""
	
	for k,v in pairs( slotData ) do
		mw.log( k ) 
	end

	local res = ""
	if template ~= nil then
		local tree = slotData[template]
		if tree ~= nil and tree[param] ~= nil then
			res = tree[param]["_text"]
		end
	else
		--
	end
	
	return "not ready " .. res
end

return p