Модуль:GetField: различия между версиями
Pok (обсуждение | вклад) м Замена текста — «GeneratorTplId» на «getAllTpl» |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 2: | Строка 2: | ||
local JsonPaths = require('Module:JsonPaths') | local JsonPaths = require('Module:JsonPaths') | ||
local project = JsonPaths.project() | |||
local getArgs = require('Module:Arguments').getArgs | local getArgs = require('Module:Arguments').getArgs | ||
| Строка 352: | Строка 353: | ||
local moduleName = get_module_name(pagePath) | local moduleName = get_module_name(pagePath) | ||
data = data or load_cached_data(moduleName) | |||
if not data then | if not data then | ||
return "" | return "" | ||
| Строка 362: | Строка 361: | ||
local extra = flatten_entry(entry) | local extra = flatten_entry(entry) | ||
local tplStr = "{{" .. | local templatePath = tplPath | ||
if project ~= nil and project ~= "" then | |||
templatePath = tplPath .. "/" .. project | |||
templatePath = "{{#ifexist:Шаблон:" .. templatePath .. "|" .. templatePath .. "|" .. tplPath .. "}}" | |||
end | |||
local tplStr = "{{" .. templatePath .. "|id=" .. tostring(id) | |||
if extra ~= "" then | if extra ~= "" then | ||
tplStr = tplStr .. "|" .. extra | tplStr = tplStr .. "|" .. extra | ||