Modul:Klasse: Unterschied zwischen den Versionen

Aus FürthWiki
Zur Navigation springen Zur Suche springen
Zeile 4: Zeile 4:
 
pf = frame:getParent()
 
pf = frame:getParent()
 
args = pf.args
 
args = pf.args
title = mw.title.getCurrentTitle()
 
 
 
 
-- The tab "Daten" is visible everytime
 
-- The tab "Daten" is visible everytime
Zeile 13: Zeile 12:
 
t ='<div class=factbox><tabs>' ..  
 
t ='<div class=factbox><tabs>' ..  
 
  tab_daten ..  
 
  tab_daten ..  
  '</tabs></div>'.. title.fullText
+
  '</tabs></div>'
  --.. frame:getParent():getParent():getTitle()
+
   
 
 
 
-- Use preprocess to render the factbox and all contens at once
 
-- Use preprocess to render the factbox and all contens at once
 
return frame:preprocess(t)
 
return frame:preprocess(t)
Zeile 22: Zeile 20:
 
function p.Daten( frame, args )
 
function p.Daten( frame, args )
 
t = frame:expandTemplate{title = 'Klasse.Daten', args={
 
t = frame:expandTemplate{title = 'Klasse.Daten', args={
KlassenName=frame:preprocess('{{PAGENAME}}'),
+
KlassenName=mw.title.getCurrentTitle().fullText,
 
         KlassenBildHauptseite=args.KlassenBildHauptseite,
 
         KlassenBildHauptseite=args.KlassenBildHauptseite,
 
         KlassenBildKategorie=args.KlassenBildKategorie,
 
         KlassenBildKategorie=args.KlassenBildKategorie,

Version vom 31. Januar 2024, 13:38 Uhr

local p = {} --p stands for package

function p.Faktenbox( frame )
	pf = frame:getParent()
	args = pf.args
	
	-- The tab "Daten" is visible everytime
	tpl_daten = p.Daten( frame, args )
	tab_daten='<tab name=Daten>' .. 
	tpl_daten .. '</tab>'
	
	t ='<div class=factbox><tabs>' .. 
	   tab_daten .. 
	   '</tabs></div>'
	   
	-- Use preprocess to render the factbox and all contens at once
	return frame:preprocess(t)
end

function p.Daten( frame, args )
	t = frame:expandTemplate{title = 'Klasse.Daten', args={
		KlassenName=mw.title.getCurrentTitle().fullText,
        KlassenBildHauptseite=args.KlassenBildHauptseite,
        KlassenBildKategorie=args.KlassenBildKategorie,
        KlassenKategorie=args.KlassenKategorie}
	}
    return t
end

return p