Модул:Wd: Разлика между версии
Изтрито е съдържание Добавено е съдържание
Ted Masters (беседа | приноси) Редакция без резюме |
Carbonaro. (беседа | приноси) малко допълнение, при което се прескача употребата на шаблон, ако са попълнени само полетата URL и „заглавие“ Етикет: Отменени |
||
Ред 1983:
-- both cite and at least one param from params (either "url", "title" or "stated in")
-- should evaluate to true
if cite then
if cite and (params[key[p.aliasesP.referenceURL]] or params[key[p.aliasesP.title]] or params[key[p.aliasesP.statedIn]]) then▼
-- iterate through table and find the number of entries
-- if this module is being substituted then build a regular template call, otherwise expand the template▼
local count = 0
if mw.isSubsting() then▼
if count == 2 and params[key[p.aliasesP.referenceURL]] and params[key[p.aliasesP.title]] then
value = '[' .. params[key[p.aliasesP.referenceURL]] .. ' ' .. params[key[p.aliasesP.title]] .. ']'
▲
▲ -- if this module is being substituted then build a regular template call, otherwise expand the template
▲ if mw.isSubsting() then
for k, v in pairs(params) do
end
value = '{{' .. cite .. value .. '}}'
else▼
value = mw.getCurrentFrame():expandTemplate{title=cite, args=params}▼
end
▲ value = '{{' .. cite .. value .. '}}'
▲ else
▲ value = mw.getCurrentFrame():expandTemplate{title=cite, args=params}
end
end
|