Module:CRTModel: Difference between revisions

No edit summary
No edit summary
Line 125: Line 125:


if model_code then
if model_code then
addRow(tbl, 'Model code', model_code, false)
addRow(tbl, 'Model', model_code, false)
else
else
addRow(tbl, 'Model code', '', false)
addRow(tbl, 'Model', '', false)
end
end


Line 153: Line 153:
addRow(tbl, 'ECID', frame:preprocess(ecidWikitext), true)
addRow(tbl, 'ECID', frame:preprocess(ecidWikitext), true)


if height or width or depth then
-- Dimensions section: show if we have height/width/depth OR weight
if height or width or depth or weight then
addSectionRow(tbl, 'Dimensions')
addSectionRow(tbl, 'Dimensions')
local h = height or '–'
local w = width or '–'
if height or width or depth then
local d = depth or '–'
local h = height or '–'
addRow(tbl, 'H × W × D', string.format('%s × %s × %s', h, w, d), false)
local w = width or '–'
end
local d = depth or '–'
 
addRow(tbl, 'H × W × D', string.format('%s × %s × %s', h, w, d), false)
-- Weight row: uses #show, so preprocess it
end
if weight then
local weightWikitext = '{{#show: ' .. fullPageName .. ' |?Weight # lb }} / {{#show: ' .. fullPageName .. ' |?Weight # kg }}'
-- Weight row: uses #show, so preprocess it
addRow(tbl, 'Weight', frame:preprocess(weightWikitext), true)
if weight then
local weightWikitext = '{{#show: ' .. fullPageName .. ' |?Weight # lb }} / {{#show: ' .. fullPageName .. ' |?Weight # kg }}'
addRow(tbl, 'Weight', frame:preprocess(weightWikitext), true)
end
end
end


MediaWiki Appliance - Powered by TurnKey Linux