Modul:Gebäude: Unterschied zwischen den Versionen
Aus FürthWiki
(+ Gebäude-Komplex-Handling. Übernahme von Work) |
(GetPLZ() von Module:Geocode) |
||
| Zeile 2: | Zeile 2: | ||
local c = require("Module:Common") | local c = require("Module:Common") | ||
local str = require("Modul:String") | local str = require("Modul:String") | ||
local g = require("Module:Geocode") | |||
function p.Faktenbox(frame) | function p.Faktenbox(frame) | ||
local args = c.shallowcopy(frame:getParent().args) | local args = c.shallowcopy(frame:getParent().args) | ||
args["PLZ"] = | args["PLZ"] = g.GetPLZ(frame:getParent()) | ||
local tpl_bild = p.bild(frame, args) | local tpl_bild = p.bild(frame, args) | ||
| Zeile 70: | Zeile 71: | ||
function p.unternehmen(frame, args) | function p.unternehmen(frame, args) | ||
return frame:expandTemplate{title='Gebäude/Unternehmen', args=args} | return frame:expandTemplate{title='Gebäude/Unternehmen', args=args} | ||
end | end | ||
return p | return p | ||
Version vom 20. September 2025, 10:24 Uhr
Seiten-Übersicht
| Hauptseite | Unterseiten | ||
|---|---|---|---|
| Allgemein | |||
| Faktenbox | Vorlagen | ||
| Formulare |
|
||
| Module | |||
| Abfrage | Vorlagen |
| |
| Formulare |
| ||
| Sonstige | |||
Siehe auch
local p = {} --p stands for package
local c = require("Module:Common")
local str = require("Modul:String")
local g = require("Module:Geocode")
function p.Faktenbox(frame)
local args = c.shallowcopy(frame:getParent().args)
args["PLZ"] = g.GetPLZ(frame:getParent())
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 tpl_personen = p.personen(frame, args)
local tab_personen=''
if tpl_personen:gsub("%s+", "") ~= '' then
tab_personen = '<tab name=Personen>' ..
tpl_personen .. '</tab>'
end
local tpl_unternehmen = p.unternehmen(frame, args)
local tab_unternehmen=''
if tpl_unternehmen:gsub("%s+", "") ~= '' then
tab_unternehmen = '<tab name=Unternehmen>' ..
tpl_unternehmen .. '</tab>'
end
local t ='<div class=factbox><tabs>' ..
tab_bild ..
tab_karte ..
tab_daten ..
tab_personen ..
tab_unternehmen ..
'</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='Gebäude/Daten', args=args}
end
function p.karte(frame, args)
return frame:expandTemplate{title='Gebäude/Karte', args=args}
end
function p.personen(frame, args)
return frame:expandTemplate{title='Gebäude/Personen', args=args}
end
function p.unternehmen(frame, args)
return frame:expandTemplate{title='Gebäude/Unternehmen', args=args}
end
return p