Module:Infobox Item: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
{ name = 'aka', func = 'has_content' }, | { name = 'aka', func = 'has_content' }, | ||
{ name = 'image', func = 'image' }, | { name = 'image', func = 'image' }, | ||
} | } | ||
Line 53: | Line 31: | ||
ret:defineLinks({ hide = true }) | ret:defineLinks({ hide = true }) | ||
ret:useSMWOne({ | -- ret:useSMWOne({ | ||
-- members = 'All Is members only', | |||
-- id_smw = 'All Item ID', | |||
-- image_smw = 'All Image', | |||
}) | -- }) | ||
ret:useSMWSubobject({ | -- ret:useSMWSubobject({ | ||
-- version = 'Version anchor', | |||
-- release = 'Release date', | |||
-- id_smw = 'Item ID', | |||
-- description = 'Description', | |||
-- members = 'Is members only', | |||
-- buyvalue = 'Buyable for', | |||
-- sellvalue = 'Sellable for', | |||
-- image_smw = 'Image', | |||
-- market_buy_limit = 'Buy limits', | |||
-- market_sell_limit = 'Sell limits', | |||
-- usesinfobox = 'Uses infobox', | |||
}) | -- }) | ||
ret:addButtonsCaption() | ret:addButtonsCaption() | ||
ret:defineName('Infobox Item') | ret:defineName('Infobox Item') | ||
Line 105: | Line 83: | ||
end | end | ||
ret:finish() | |||
end | end | ||
return p | return p |
Revision as of 07:46, 1 April 2022
Documentation for this module may be created at Module:Infobox Item/doc
-------------------------- -- Module for [[Template:Infobox Item]] ------------------------ local p = {} local infobox = require('Module:Infobox') local onmain = require('Module:Mainonly').on_main local commas = require('Module:Addcommas')._add VariablesLua = mw.ext.VariablesLua function p.main(frame) local args = frame:getParent().args local ret = infobox.new(args) ret:defineParams{ --- General { name = 'name', func = 'name' }, { name = 'version', func = 'has_content' }, { name = 'aka', func = 'has_content' }, { name = 'image', func = 'image' }, } ret:setMaxButtons(7) ret:create() ret:cleanParams() ret:customButtonPlacement(true) ret:setDefaultVersionSMW(true) ret:defineLinks({ hide = true }) -- ret:useSMWOne({ -- members = 'All Is members only', -- id_smw = 'All Item ID', -- image_smw = 'All Image', -- }) -- ret:useSMWSubobject({ -- version = 'Version anchor', -- release = 'Release date', -- id_smw = 'Item ID', -- description = 'Description', -- members = 'Is members only', -- buyvalue = 'Buyable for', -- sellvalue = 'Sellable for', -- image_smw = 'Image', -- market_buy_limit = 'Buy limits', -- market_sell_limit = 'Sell limits', -- usesinfobox = 'Uses infobox', -- }) ret:addButtonsCaption() ret:defineName('Infobox Item') ret:addClass('infobox-item') ret:addRow{ { tag = 'argh', content = 'name', class='infobox-header', colspan = '20' } } :pad(20) :addRow{ { tag = 'argd', content = 'image', class = 'infobox-image inventory-image infobox-full-width-content', colspan = '20' } } :pad(20) :addRow{ { tag = 'th', content = 'Released', colspan = '7' }, { tag = 'argd', content = 'release', colspan = '13' } } if ret:paramDefined('removal') then ret:addRow{ { tag = 'th', content = 'Removal', colspan = '7' }, { tag = 'argd', content = 'removal', colspan = '13' } } end if ret:paramDefined('aka') then ret:addRow{ { tag = 'th', content = 'Also called', colspan = '7' }, { tag = 'argd', content = 'aka', colspan = '13' } } end ret:finish() end return p