Modulo:ItemLink

Da Conan Exiles Wiki.

La documentazione per questo modulo può essere creata in Modulo:ItemLink/man

local p = {}
local cargo = mw.ext.cargo

function p.Main( frame )
	local text = ""
    tables = 'Item'
    fields = '_pageName,image,dlcPackage'
    local args = {
        where = 'uniqueName = "' .. frame.args[1] .. '" AND _pageName=uniqueName AND NOT _pageName LIKE "%Template%"',
        groupBy = '_pageName',
        limit = 1
    }
    local result = cargo.query( tables, fields, args )
    local r = result[1]
    if r == nil then
		text = '[[' .. frame.args[1] .. ']]'
	else 
		if r['dlcPackage'] ~= "" then
			text = '<span style="position: relative; display: inline-block;"><span style="display: block;">[[File:' .. r['image'] .. '|32px|link=' .. r['_pageName'] .. '|frameless]]</span><span style="position: absolute; display: block; top: 0; bottom: 0; left: 0; right: 0;">[[File:T DLC icon.png|32px|link=' .. r['_pageName'] .. ']]</span></span>'
		else
			text = '[[File:' .. r['image'] .. '|32px|link=' .. r['_pageName'] .. '|frameless]]'
		end
		text = text .. ' [['.. r['_pageName'] .. ']]'
	end
    return text
end

return p