Module:Accessory: Difference between revisions
Simplify Compatible CRT Models to a bulleted list of linked page names instead of a table (via update-page on MediaWiki MCP Server) |
Add Dimensions section (H × W × D and Weight) to infobox, matching CRT model pattern (via update-page on MediaWiki MCP Server) |
||
| Line 72: | Line 72: | ||
local description = trim(args.description) | local description = trim(args.description) | ||
local image_main = trim(args.image_main) | local image_main = trim(args.image_main) | ||
-- Physical specifications | |||
local height = trim(args.height) | |||
local width = trim(args.width) | |||
local depth = trim(args.depth) | |||
local weight = trim(args.weight) | |||
-- Option card specific | -- Option card specific | ||
| Line 143: | Line 149: | ||
local ecidWikitext = string.format('[{{fullurl:%s|curid=%d}} EC%d]', pageName, pageId, pageId) | local ecidWikitext = string.format('[{{fullurl:%s|curid=%d}} EC%d]', pageName, pageId, pageId) | ||
addRow(container, 'ECID', frame:preprocess(ecidWikitext), true) | addRow(container, 'ECID', frame:preprocess(ecidWikitext), true) | ||
-- Dimensions section | |||
if height or width or depth or weight then | |||
addSectionRow(container, 'Dimensions') | |||
if height or width or depth then | |||
local h = height or '–' | |||
local w = width or '–' | |||
local d = depth or '–' | |||
addRow(container, 'H × W × D', string.format('%s × %s × %s', h, w, d), false) | |||
end | |||
if weight then | |||
local weightWikitext = '{{#show: ' .. fullPageName .. ' |?Weight # lb }} / {{#show: ' .. fullPageName .. ' |?Weight # kg }}' | |||
addRow(container, 'Weight', frame:preprocess(weightWikitext), true) | |||
end | |||
end | |||
-- Compatible CRT models section | -- Compatible CRT models section | ||