Module:CRTModel: Difference between revisions
Add link=none to outputs query to prevent unwanted linking of count/location (via update-page on MediaWiki MCP Server) |
Adding chassis_family display in infobox (via update-page on MediaWiki MCP Server) |
||
| Line 80: | Line 80: | ||
local tvl = trim(args.tvl) | local tvl = trim(args.tvl) | ||
local chassis = trim(args.chassis) | local chassis = trim(args.chassis) | ||
local chassis_family = trim(args.chassis_family) | |||
local remote_control = trim(args.remote_control) | local remote_control = trim(args.remote_control) | ||
local height = trim(args.height) | local height = trim(args.height) | ||
| Line 202: | Line 203: | ||
end | end | ||
if chassis then | -- Chassis row: display both label chassis and family if available | ||
local chassisWikitext = string.format( | if chassis or chassis_family then | ||
local chassisDisplay = '' | |||
) | if chassis then | ||
local chassisWikitext = string.format( | |||
addRow(container, 'Chassis', | '{{#formredlink: target=%s |form=Chassis |existing page link text=%s }}', | ||
chassis, chassis | |||
) | |||
chassisDisplay = frame:preprocess(chassisWikitext) | |||
end | |||
if chassis_family then | |||
local familyWikitext = string.format( | |||
'{{#formredlink: target=Chassis family:%s |form=Chassis family |existing page link text=%s }}', | |||
chassis_family, chassis_family | |||
) | |||
local familyHtml = frame:preprocess(familyWikitext) | |||
if chassis then | |||
-- Both: show chassis with family in parentheses on next line | |||
chassisDisplay = chassisDisplay .. '<br><small>Family: ' .. familyHtml .. '</small>' | |||
else | |||
-- Only family: show family alone | |||
chassisDisplay = familyHtml .. ' <small>(family)</small>' | |||
end | |||
end | |||
addRow(container, 'Chassis', chassisDisplay, true) | |||
end | end | ||