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 | addRow(tbl, 'Model', model_code, false) | ||
else | else | ||
addRow(tbl, 'Model | 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 '–' | |||
if height or width or depth then | |||
local h = height or '–' | |||
local w = width or '–' | |||
local d = depth or '–' | |||
addRow(tbl, 'H × W × D', string.format('%s × %s × %s', h, w, d), false) | |||
end | |||
-- Weight row: uses #show, so preprocess it | |||
if weight then | |||
local weightWikitext = '{{#show: ' .. fullPageName .. ' |?Weight # lb }} / {{#show: ' .. fullPageName .. ' |?Weight # kg }}' | |||
addRow(tbl, 'Weight', frame:preprocess(weightWikitext), true) | |||
end | |||
end | end | ||