Module:Flagg and Module:Flagg/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
p[''] = p.main |
Plastikspork (talk | contribs) Add frameOnly |
||
Line 13: | Line 13: | ||
--Get input arguments |
--Get input arguments |
||
local args = require('Module:Arguments').getArgs(frame,{ |
local args = require('Module:Arguments').getArgs(frame,{ |
||
frameOnly = ((frame.args.frameonly or '') ~= ''), |
|||
function(key,value) |
valueFunc = function(key,value) |
||
if value then |
if value then |
||
value = mw.text.trim(value) |
value = mw.text.trim(value) |
||
Line 185: | Line 186: | ||
if mn == "*" and clink ~= flink then |
if mn == "*" and clink ~= flink then |
||
text = text:sub(1, -3) .. "\226\128\175*]]" end |
text = text:sub(1, -3) .. "\226\128\175*]]" end |
||
elseif mn=="l" then --display link target |
|||
text = flink=="" and name or "[["..flink..fsec.."|"..(args["name"] or flink).."]]" |
|||
elseif mn=="b" then --both prefix/suffix and normal country link |
elseif mn=="b" then --both prefix/suffix and normal country link |
||
local preflink = pref and (flink=="" and pref.." " or "[["..flink..fsec.."|"..pref.."]] ") or "" |
local preflink = pref and (flink=="" and pref.." " or "[["..flink..fsec.."|"..pref.."]] ") or "" |
||
Line 203: | Line 202: | ||
text = name |
text = name |
||
elseif mn=="a" then --abbr |
elseif mn=="a" then --abbr |
||
text = |
text = clink==name and name or "<abbr title='"..clink.."'>"..name.."</abbr>" |
||
else --country link (default) |
else --country link (default) |
||
text = clink=="" and name or "[["..clink..csec.."|"..name.."]]" |
text = clink=="" and name or "[["..clink..csec.."|"..name.."]]" |
||
Line 262: | Line 261: | ||
if iname==placeholder then |
if iname==placeholder then |
||
if require('Module:yesno')(args["noredlink"]) == false |
if require('Module:yesno')(args["noredlink"]) == false then |
||
⚫ | |||
if country ~= '' and data.alias == nil then |
|||
⚫ | |||
⚫ | |||
⚫ | |||
if args["noredlink"] == "notext" then |
|||
text = '' |
|||
end |
|||
end |
|||
end |
end |
||
if (args["missingcategory"] or '') ~= '' then |
if (args["missingcategory"] or '') ~= '' then |
||
Line 326: | Line 320: | ||
end |
end |
||
p[''] = p.main |
|||
return p |
return p |