Module:Products: Difference between revisions
Make limit a parameter; Make used item images smaller
(Rename "item" parameter to "1", since many pages are using it like that anyways) |
(Make limit a parameter; Make used item images smaller) |
||
Line 14:
local showPrices = yesno(args.showPrices)
local showValues = yesno(args.showValues)
local limit = tonumber(args.limit or 0) or 0
if limit <= 0 then
end
-- Query for data
Line 20 ⟶ 24:
'?Uses item',
'?Recipe JSON',
showValues and '?Value',▼
▲ 'limit=500',
limit = limit
▲ showValues and '?Value'
}
if not smw_data then
Line 68 ⟶ 72:
-- Create table
local out = mw.html.create('table')
:addClass('wikitable align-right-1')
:tag('tr')
:tag('th')
Line 123 ⟶ 127:
for _, item in ipairs(recipe.materials) do
ingredients:tag('li')
:wikitext(('%s × [[File:%s.png|link=%s|
:done()
end
|