Content deleted Content added
S.A. Julio (talk | contribs) add custom options |
S.A. Julio (talk | contribs) allow for type=WNT |
||
Line 161:
local args = require'Module:Arguments'.getArgs(frame, {trim = true})
local root = mw.html.create()
local matchType = (args.type == 'WNT' or args.type == 'MNT') and 'NT' or (args.type or 'club') -- Set default match type to 'club'
local isWNT = args.type == 'WNT' -- Track if WNT was set
local flagTemplate, flagParam1
local noFlagIcons = false
Line 170 ⟶ 171:
flagTemplate, flagParam1 = processIcon(args.flag) -- Process flag icons with variants
else
if args.flag then
flagTemplate = args.flag
elseif isWNT then
flagTemplate = 'fbw' -- Default to {{fbw}} for WNT matches
elseif matchType == 'NT' then
flagTemplate = 'fb' -- Default to {{fb}} for NT/MNT matches
else
flagTemplate = 'fbaicon' -- Default to {{fbaicon}} for club matches
end
end
if args.flag and (flagTemplate == 'n' or flagTemplate == 'no' or flagTemplate == '0' or flagTemplate == 'false' or flagTemplate == 'null' or flagTemplate == 'none' or flagTemplate == 'noflag') then
noFlagIcons = true -- Hide flag icons for club matches
if matchType == 'NT' then
flagTemplate = isWNT and 'fbw' or 'fb' -- Set flagTemplate to "fbw"/"fb"
end
end
-- Check if flagTemplate exists and adjust if necessary
if matchType == 'NT' and (flagTemplate ~= 'fb' and flagTemplate ~= 'fbw') then
if not templateExists(flagTemplate) or not templateExists(flagTemplate .. '-rt') then
flagTemplate = isWNT and 'fbw' or 'fb'
end
elseif not noFlagIcons and flagTemplate ~= 'fbaicon' then
|