Module:CRTModel: Difference between revisions
Reverted chassis link to use standard #formredlink without prefill (via update-page on MediaWiki MCP Server) Tag: Manual revert |
Add Control Ports section to infobox rendering (via update-page on MediaWiki MCP Server) |
||
| Line 528: | Line 528: | ||
addSectionRow(container, 'Outputs') | addSectionRow(container, 'Outputs') | ||
addFullRow(container, outputsHtml, 'padding:0.2em 0.4em;', true) | addFullRow(container, outputsHtml, 'padding:0.2em 0.4em;', true) | ||
end | |||
-- Control Ports section: query for control port subobjects | |||
local controlPortsCountWikitext = | |||
'{{#ask:\n' .. | |||
' [[Has CRT model::' .. fullPageName .. ']]\n' .. | |||
' [[Has control signal format::+]]\n' .. | |||
' |format=count\n' .. | |||
'}}' | |||
local controlPortCount = frame:preprocess(controlPortsCountWikitext) | |||
local hasControlPorts = controlPortCount and tonumber(trim(controlPortCount)) and tonumber(trim(controlPortCount)) > 0 | |||
if hasControlPorts then | |||
local controlPortsAskWikitext = | |||
'{{#ask:\n' .. | |||
' [[Has CRT model::' .. fullPageName .. ']]\n' .. | |||
' [[Has control signal format::+]]\n' .. | |||
' |?Has control signal format=signal\n' .. | |||
' |?Has control port connector=connector\n' .. | |||
' |?Has control port direction=direction\n' .. | |||
' |?Has control port count=count\n' .. | |||
' |?Has control port label=label\n' .. | |||
' |?Has control port location=location\n' .. | |||
' |format=ul\n' .. | |||
' |template=CRT control port inline\n' .. | |||
' |named args=yes\n' .. | |||
' |link=none\n' .. | |||
' |searchlabel=\n' .. | |||
'}}' | |||
local controlPortsHtml = frame:preprocess(controlPortsAskWikitext) | |||
addSectionRow(container, 'Control Ports') | |||
addFullRow(container, controlPortsHtml, 'padding:0.2em 0.4em;', true) | |||
end | end | ||