Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 135: | Строка 135: | ||
local switchConfigs = { | local switchConfigs = { | ||
card = { | card = { | ||
param = "card", | |||
wrapper = function(key, tplCalls) | wrapper = function(key, tplCalls) | ||
if not tplCalls or #tplCalls == 0 then return "" end | if not tplCalls or #tplCalls == 0 then return "" end | ||
return "" .. mw.text.encode(key) .. "|" .. table.concat(tplCalls, " ") .. "" | return "|" .. mw.text.encode(key) .. "|" .. table.concat(tplCalls, " ") .. "" | ||
end | end | ||
}, | }, | ||
title = { | title = { | ||
param = "title", | |||
wrapper = function(key, tplCalls) | wrapper = function(key, tplCalls) | ||
local parts = {} | local parts = {} | ||
| Строка 184: | Строка 186: | ||
table.insert(switchKeyOrder[sw], key) | table.insert(switchKeyOrder[sw], key) | ||
end | end | ||
table.insert(switchKeyToTemplates[sw][key], "{{" .. tplPath .. "| | local param = (switchConfigs[sw] and switchConfigs[sw].param) | ||
table.insert(switchKeyToTemplates[sw][key], "{{" .. tplPath .. "|" .. param .. "|" .. key .. "}}") | |||
end | end | ||
end | end | ||