Modul:Stadtteil: Unterschied zwischen den Versionen
Aus FürthWiki
HeikoK (Diskussion | Beiträge) (Umstellung Slash anstelle Dot) |
Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
local p = {} --p stands for package | local p = {} --p stands for package | ||
function p.Faktenbox( frame ) | function p.Faktenbox(frame) | ||
local args = frame:getParent().args | |||
tpl_bild = p. | local tpl_bild = p.bild(frame, args) | ||
tab_bild='' | local tab_bild='' | ||
if tpl_bild:gsub("%s+", "") ~= '' then | if tpl_bild:gsub("%s+", "") ~= '' then | ||
tab_bild='<tab name=Bild>' .. | tab_bild='<tab name=Bild>' .. | ||
| Zeile 12: | Zeile 11: | ||
end | end | ||
tpl_karte = p. | local tpl_karte = p.karte(frame, args) | ||
tab_karte='' | local tab_karte='' | ||
if tpl_karte:gsub("%s+", "") ~= '' then | if tpl_karte:gsub("%s+", "") ~= '' then | ||
tab_karte='<tab name=Karte>' .. | tab_karte='<tab name=Karte>' .. | ||
| Zeile 20: | Zeile 19: | ||
-- The tab "Daten" is visible everytime | -- The tab "Daten" is visible everytime | ||
tpl_daten = p. | local tpl_daten = p.daten(frame, args) | ||
tab_daten='<tab name=Daten>' .. | local tab_daten='<tab name=Daten>' .. | ||
tpl_daten .. '</tab>' | tpl_daten .. '</tab>' | ||
t ='<div class=factbox><tabs>' .. | local t ='<div class=factbox><tabs>' .. | ||
tab_karte .. | tab_karte .. | ||
tab_bild .. | tab_bild .. | ||
| Zeile 34: | Zeile 33: | ||
end | end | ||
function p. | function p.bild(frame, args) | ||
return frame:expandTemplate{title = 'Bildertab', args=args} | |||
end | end | ||
function p. | function p.daten(frame, args) | ||
return frame:expandTemplate{title = 'Stadtteil/Daten', args=args} | |||
end | end | ||
function p. | function p.karte (frame, args) | ||
return frame:expandTemplate{title = 'Stadtteil/Karte', args=args} | |||
end | end | ||
return p | return p | ||
Version vom 24. August 2025, 13:20 Uhr
Seiten-Übersicht
| Hauptseite | Unterseiten | ||
|---|---|---|---|
| Allgemein | |||
| Faktenbox | Vorlagen | ||
| Formulare |
|
||
| Module | |||
| Abfrage | Vorlagen |
| |
| Formulare |
| ||
| Sonstige | |||
Siehe auch
local p = {} --p stands for package
function p.Faktenbox(frame)
local args = frame:getParent().args
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
local tpl_karte = p.karte(frame, args)
local tab_karte=''
if tpl_karte:gsub("%s+", "") ~= '' then
tab_karte='<tab name=Karte>' ..
tpl_karte .. '</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_karte ..
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 = 'Bildertab', args=args}
end
function p.daten(frame, args)
return frame:expandTemplate{title = 'Stadtteil/Daten', args=args}
end
function p.karte (frame, args)
return frame:expandTemplate{title = 'Stadtteil/Karte', args=args}
end
return p