Модуль:Item link: различия между версиями
Материал из Celadon | Wiki Sierra
Дополнительные действия
[[commons:MediaWiki]]>BOT Purple Новая страница: «local p = {} function p.Main( frame ) local cargo = mw.ext.cargo local text = '<span class="tooltip-hover" id="' .. frame.args[1] .. '" >' tables = '...» |
Armowich (обсуждение | вклад) м 1 версия импортирована |
||
(нет различий)
| |||
Текущая версия от 21:41, 7 декабря 2025
Для документации этого модуля может быть создана страница Модуль:Item link/doc
local p = {}
function p.Main( frame )
local cargo = mw.ext.cargo
local text = '<span class="tooltip-hover" id="' .. frame.args[1] .. '" >'
tables = 'Objects'
fields = 'Image,Description'
local args = {
where = '_pageName = "' .. frame.args[1] .. '"',
limit = 1,
default = '_pageName'
}
local results = cargo.query( tables, fields, args )
for i, v in ipairs(results) do
text = text .. '[[File:'..v["Image"]..'.png|18px|link='.. frame.args[1] ..']]'
text = text .. '[['.. frame.args[1] ..']]'
end
text = text .. "</span>"
return text
end
return p