Module:Infobox Shop: Difference between revisions
Appearance
Add shop infobox module  |
Only format if not empty  |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
   local shop_args = { |    local shop_args = { | ||
     {'t',   args.shopname}, |      {'t',   args.shopname}, | ||
     {' |      {'i',   args.image and args.image ~= '' and string.format('[[File:%s|300px]]', args.image) or ''}, | ||
 |     | ||
    {'s',   'General Information'}, | |||
    {'f',   'Shop Name',  args.shopname}, | |||
     {'f',   'Owner',    args.shopowner}, |      {'f',   'Owner',    args.shopowner}, | ||
     {'f',   'Type',    args.shoptype}, |      {'f',   'Type',    args.shoptype}, | ||
     {'f',   ' |      {'f',   'Season',   args.season}, | ||
     {'s',   'Location'}, |      {'s',   'Location'}, | ||
Latest revision as of 11:00, 24 June 2025
Documentation for this module may be created at Module:Infobox Shop/doc
local p = {}
local infobox = require("Module:Infobox")
function p.infobox(frame)
local args = frame:getParent().args
local shop_args = {
{'t', args.shopname},
{'i', args.image and args.image ~= '' and string.format('[[File:%s|300px]]', args.image) or ''},
{'s', 'General Information'},
{'f', 'Shop Name', args.shopname},
{'f', 'Owner', args.shopowner},
{'f', 'Type', args.shoptype},
{'f', 'Season', args.season},
{'s', 'Location'},
{'f', 'Location', args.location},
{'f', 'Coordinates', args.coordinates},
{'s', 'Dates'},
{'f', 'Date Opened', args.dateopened},
{'f', 'Date Closed', args.dateclosed},
{'s', 'Inventory'},
{'f', 'Items Sold', args.items},
{'f', 'Currency', args.currency},
{'s', 'About'},
{'f', 'Description', args.description},
}
return infobox.infobox {
getParent = function() return { args = shop_args } end
}
end
return p