Modul:Ereignis

Version vom 30. August 2025, 15:10 Uhr von HeikoBot (Diskussion | Beiträge) ({title = 'CommonTabs/Bild', args=args})
local p = {} --p stands for package

function p.Faktenbox(frame)
	local args = frame:getParent().args
	
	-- Before you ask: No, you cant' use extensionTag here!
	local tpl_bild = p.bild(frame, args)
	local tab_bild=''
	if tpl_bild:gsub("%s+", "") ~= '' then
		tab_bild='<tab name=Bild>' .. 
		tpl_bild .. '</tab>'
	end
	
	-- The tab "Daten" is visible everytime
	local tpl_daten = p.daten(frame, args)
	local tab_daten='<tab name=Daten>' .. 
	tpl_daten .. '</tab>'
	
	local t ='<div class=factbox><tabs>' ..
	   tab_bild .. 
	   tab_daten .. 
	   '</tabs></div>'

	-- Use preprocess to render the factbox and all contens at once
	return frame:preprocess(t)
end

function p.bild(frame, args)
    return frame:expandTemplate{title = 'CommonTabs/Bild', args=args}
end

function p.daten(frame, args)
    return frame:expandTemplate{title = 'Ereignis/Daten', args=args}
end

return p