Module:CRTModel: Difference between revisions

Add type badge below infobox title showing crt_type (e.g. TV, Monitor) for visual differentiation (via update-page on MediaWiki MCP Server)
Change "Add accessory" button to link to Create_an_accessory with crt_models parameter (via update-page on MediaWiki MCP Server)
 
(8 intermediate revisions by the same user not shown)
Line 298: Line 298:
)
)


-- Type badge
-- Type badge (breadcrumb) — plainlinks hides external icon, $wgNoFollowDomainExceptions handles nofollow
addFullRow(container, crt_type or 'CRT', '', false, 'infobox-type-badge')
local badgeWikitext = '[[CRT Search|CRT]]'
if crt_type then
local typeUrl = mw.title.new('CRT Search'):fullUrl({crt_type = crt_type})
badgeWikitext = badgeWikitext .. ' › <span class="plainlinks">[' .. typeUrl .. ' ' .. crt_type .. ']</span>'
end
addFullRow(container, badgeWikitext, '', false, 'infobox-type-badge')


if image_main then
if image_main then
Line 710: Line 715:


local addAccessoryUrl = mw.uri.fullUrl(
local addAccessoryUrl = mw.uri.fullUrl(
"Special:FormEdit",
"Create an accessory",
{
{
form = "Accessory",
crt_models = pageName
["Accessory[crt_models]"] = pageName
}
}
)
)
Line 811: Line 815:
local addPartUrl = mw.uri.fullUrl(
local addPartUrl = mw.uri.fullUrl(
"Special:FormEdit",
"Create a part",
{
{
form = "Part",
crt_models = pageName
["Part[crt_models]"] = pageName
}
}
)
)
MediaWiki Appliance - Powered by TurnKey Linux