The template is not intended to fully supersede any specific flag templates it can simulate (see below), but can be useful for formats for which no template exists, or if its additional options are needed.
Parameters
Aliases (alternatives) for each parameter or value are given in square brackets.
Format (first unnamed parameter)
The first parameter is an alphabetic code specifying the output format. The first letter concerns the image, the second the separator, and the third the country name. The parameter is fully case-insensitive.
If any position in the parameter value is missing or has a character not corresponding to an option below, the options marked as default will be used; e.g. a first parameter equal to i, i** or izz will be read as isc.
First letter: Image
Letter
Meaning
Description
Example
u
unlinked
Image is not linked (default).
{{flagg|uxx|France}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheA' not found.
c
country
Image links to country/entity page.
{{flagg|cxx|France}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheA' not found.
p [f]
prefix/suffix
Image links to country name with prefixed and/or suffixed text (default "Flag of ..."), set using |pref= and |suff= (see below).
{{flagg|pxx|France}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheA' not found.
i
image page
Image links to file description page; use this for non-public-domain images, for which attribution is required.
{{flagg|ixx|France}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheA' not found.
d
data template
Image links to the used country data template, for use in discussion/documentation. Automatically adds redirect=no if link is a redirect.
{{flagg|dxx|France}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheA' not found.
No image is displayed. If the second letter is anything other than x, and o is not set, an unlinked transparent image is actually used to preserve the spacing.
{{flagg|xnx|France}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheA' not found.
Second letter: Separator
Letter
Meaning
Description
Example
s
span box
The flag image is put in a fixed-width <span> tag, meaning the country names are aligned in vertical lists; see documentation of {{Flaglist}} (default).
{{flagg|usu|Niger}} → Niger
n
non-breaking space
A non-breaking space ( ) is used, like in most flag templates, including {{flag}}. Note that does not actually prevent wrapping between image and text in all browsers; use w as described below if needed.
{{flagg|unu|Niger}} → Niger
l
line break
A line break (<br/>) is used as separator.
{{flagg|ulu|Niger}} → Niger
t
table cell
A table cell separator (two pipes) is used.
Niger
x
X mark
No separator is used.
{{flagg|uxu|Niger}} → Niger
Third letter: Name
Letter
Meaning
Description
Example
c
country
The country name links to the main country/entity page (default).
{{flagg|xxc|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
p
prefix/suffix
The country name links to the country page with prefixed or suffixed text (default "Flag of ..."), set using |pref= and |suff= (see below).
{{flagg|xxp|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
f
full prefix/suffix
Same as p, except that the prefix and/or suffix is/are displayed.
{{flagg|xxf|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
b
both country and prefix/suffix
Combined country link and prefix/suffix link: country name links to country page, while prefix and/or suffix link(s) to prefixed/suffixed title.
{{flagg|xxb|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
The country name is displayed as plain text, without link.
{{flagg|xxu|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
d
data template
Country name is linked to the used country data template, for use in discussion/documentation. Automatically adds redirect=no if a redirect is used.
{{flagg|xxd|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
x
X mark
No text is displayed.
{{flagg|xxx|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
*
Add *
Similar to "p", except that an asterisk (*) is added to the text of the link if it goes to a more specific article.
{{flagg|xx*|Chile}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheD' not found.
Some additional options can be enabled by appending the following letters to the three-letter code in any order:
Letter
Description
Example
a
Adds the country name (the "name" parameter, or if unset the second unnamed parameter) as alt text and mouseover for the image. If |alt= is used for a custom alt/mouseover text, this does not need to be separately set.
Uses the name set in the country data template (rather than the first parameter) as display name, like in {{flagcountry}} (i.e. expands abbreviated forms).
{{flagg|unue|PAK}} → ਪਾਕਿਸਤਾਨ
f
If the prefixed/suffixed article name doesn't exist, fallback to linking to the non-prefixed/suffixed page. This may be expensive, and the number of time it can be used on single page is limited.
{{flagg|psff|Egypt|pref=Flag templates in}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheE' not found. Compare with: {{flagg|psf|Egypt|pref=Flag templates in}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheE' not found.
l
Adds the link name (as defined by the "image" parameter) as alt text and mouseover for the image. If |alt= is used for a custom alt/mouseover text, this does not need to be separately set.
Omits the image and spacing in case the image is an invisible placeholder, i.e., only include the spacing if a flag is displayed. Useful for inline/standalone usages or horizontal lists, where name alignment is not needed.
Reverses the order of the elements, putting the image to the right of the name; cf. {{flagright}}. Doesn't affect the order of letters in the format code.
Avoids wrapping by adding <span class="nowrap">...</span> around the output.
{{flagg|unuw|Pakistan}} → Pakistan
t
Aligns to the left in a table.
Entity (second unnamed parameter)
The second parameter is the country or entity name. The template attempts to read the flag and link data from "Template:Country data country"; if that does not exist, the same parameter will be used as default country link and no automatic image will be displayed. The parameter also defines the default displayed country name, if the e option above is not used.
Image parameters
|variant= [third unnamed parameter]
Specifies a variant flag image, as defined and documented in each entity's data template. For example, {{flagg|ixx|Germany|naval}} → uses the "naval" variant of Template:Country data Germany.
|image=
Custom image name, with or without the "File:" namespace prefix. Can be used if the wanted image is not available as variant for the entity (you can alternatively request it be added at the respective data template's talk page), or if no data template exists. Set to "none" ["blank", empty string] to use an unlinked transparent image (functionally identical to the x format).
|size= [|sz=]
Sets the image size; default is 23×15 pixels (larger for some entities). You can use an explicit size in pixels (e.g. 30x20px; the "px" suffix is optional) or one of the relative sizes "xs" (half the default dimensions), "s", "m", "l" and "xl" (twice the default size).
|border=
By default, the flag icon includes a border, except if it is disabled in the entity's country data template. |border= can be set to "yes" ["y", "1"] to force a border when excluded by default, or "no" ["n", "0", empty string] to prevent one.
|align= [|al=]
Set to "left" ["l"], "center" ["centre", "c", "middle", "m"] or "right" ["r"] to set the alignment of the image for the span box (s) and table cell (t) formats. For t, the default is center; for s, it is right-aligned if r is set, else left-aligned.
|width= [|w=]
Sets the width of the span box surrounding the image for the span box (s) format, in pixels, without the "px" suffix. The default is calculated by Module:Flaglist and depends on the image size.
|alt=
Sets alt text and mouseover text for the flag image, if it is for information rather than just decoration. If the wanted text is equal to the entity name, use the a option described above.
|ilink=
Overrides the link target of the image (only use if none of the image formats above allow linking to the desired page).
|noredlink=no
Displays a red link to the missing country data template instead of a placeholder image. Defaults to "yes" (no red link displayed).
|missingcategory=category name
Adds the page to category name if the image if the country data is missing.
Text and link parameters
|name=
Changes the displayed country name. Note that with the f format, this includes the prefix and/or suffix.
|clink= [|link=]
Overwrites the link to the country article; this is also used to construct the prefix/suffix link for the f, p and b options.
|pref=, |suff=, |plink=
|pref= and |suff= set the prefix and suffix to use for the prefix/suffix links (format letters f, p and b). The default, if neither is specified, is "Flag of" as prefix (cf. {{flagof}}) and no suffix. |plink= can be used to override the combined link.
|the=
Set to "yes" ["y", "1"] to include the article "the" before the country name in the prefix/suffix links. Example: {{flagg|usf|Philippines|the=1}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheE' not found.. Use |pthe= if the link needs "the" but the name doesn't, and |nthe= if the name needs it but the link doesn't.
|section=
Links to a section of the linked article without displaying the section name. If both a country link and a prefix/suffix link are used, use |csection= for a section of the country article, and |psection= for a section of the prefixed/suffixed article.
|altvar= [|avar=], |age=
Enables using one of a set of standard suffixes for linking to sports teams and militaries. The altvar and suffix data is loaded from Module:Flagg/Altvar data. The possible parameter values are the base names of the corresponding specialized templates; alias values from full sports names exist (see examples below and data page). For some entities this also changes the image to a variant specific to a sport or military branch; for example, {{flagg|usp|Ireland|avar=ru}} → Ireland uses the IRFU flag to represent the Irish rugby union team. For youth teams in some sports (see the data page), the age limit must be additionally set using |age=.
|nalign= [|nal=]
Sets the alignment of the text in table cell format (t). The default is left; the possible values are the same as for |align=.
|text=
Overrides the entire text; only use when necessary for any nonstandard formats. Alternatively, you can set the third letter of the format parameter to x (no text) and add custom text outside the template.
|nodata=y
Overrides attempts to use the corresponding {{country data ...}} template, which is useful when the corresponding data template doesn't exist.
|pref2=, |suff2=, |plink2=, |psection2=
If the f extra is specified, and the prefix/suffixed article name being linked to doesn't exist, then use these parameters as an alternate prefix/suffix, and check if it exists as well. (If it still doesn't exist, then fall back to the non-prefixed/suffixed page as normal). This may be expensive, and the number of time it can be used on single page is limited.
Examples
Formats:
{{flagg|usc|Fiji}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheK' not found. (default format)
{{flagg||Fiji}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheK' not found. (default format)
{{flagg|pnbr|Fiji}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheK' not found.
<span style="display:inline-block;text-align:center;">{{flagg|ilf|Fiji|sz=xl}}</span> → Lua error in package.lua at line 80: module 'Module:CountryData/cacheK' not found.
Table format & alignment:
{{flagg|utu|Jamaica}}
Lua error in package.lua at line 80: module 'Module:CountryData/cacheG' not found.
{{flagg|utur|Jamaica}}
Lua error in package.lua at line 80: module 'Module:CountryData/cacheG' not found.
{{flagg|utu|Jamaica|al=l|nal=l}}
Lua error in package.lua at line 80: module 'Module:CountryData/cacheG' not found.
{{flagg|utu|Jamaica|al=c|nal=c}}
Lua error in package.lua at line 80: module 'Module:CountryData/cacheG' not found.
{{flagg|utu|Jamaica|al=r|nal=r}}
Lua error in package.lua at line 80: module 'Module:CountryData/cacheG' not found.
{{flagg|usu|Switzerland}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheB' not found.
{{flagg|usu|Switzerland|al=l}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheB' not found.
{{flagg|usu|Switzerland|al=c}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheB' not found.
{{flagg|usu|Switzerland|al=r}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheB' not found.
Standard image & name parameters:
{{flagg|isc|Myanmar}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheJ' not found.
{{flagg|isc|Myanmar|border=}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheJ' not found.
Once you have a table with {{flaglist}} or other flag template it is easy to convert the links to specialized links. So instead of Oklahoma you would have Incarceration in Oklahoma, or if that article does not exist, then Crime in Oklahoma.
Use a global find-and-replace in the wikitext. Replace:
{{flaglist
with
{{flagg|us*eft|pref=Incarceration in|pref2=Crime in
The {{flagg}} template looks for the articles. If it finds one of the two choices it adds the link and an asterisk after the state, country, territory, or other subnational area name. If it does not find either article, it just adds the standard link.
Substitute your preferred topics in the pref= and pref2= spots. For more info see Help:Table and its sections on adding flags and country/state/territory links.
This particular use of {{flagg}} parameters is expensive and can only be used on a few hundred links per article. Every time the article is saved it occurs. So only one big country table per article. Other country tables in the same article should use standard links.
Comparison with other templates
These "specialized" templates predate Flagg, and while most do not have options for custom links and images, they are probably faster because they only do two transclusions without invoking Lua.
{{flaglink|China|at the Hopman Cup}} → ਫਰਮਾ:Flaglink {{flagg|unp|China|suff=at the Hopman Cup}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheB' not found.
{{flagg|unp|country|pref=prefix}} (no existence check)
{{flag+link|Agriculture in|China}} → ਫਰਮਾ:Flag+link {{flagg|unp|China|pref=Agriculture in}} → Lua error in package.lua at line 80: module 'Module:CountryData/cacheB' not found.
User:SiBr4/Flagg tests — extensive tests of the template's functions, which may also serve as additional examples
localtitleSelf=mw.title.new(...ormw.getCurrentFrame():getTitle())localtitleCountryData=mw.title.new[[Module:CountryData]]iftitleSelf.isSubpagethenlocalsandbox=titleSelf.subpageText:match[[^sandbox]]ifsandboxthentitleCountryData=titleCountryData:subPageTitle(sandbox)endendlocalCountryData=require(tostring(titleCountryData))localp={}functionp.main(frame)--Get input argumentslocalargs=require('Module:Arguments').getArgs(frame,{valueFunc=function(key,value)ifvaluethenvalue=mw.text.trim(value)--Change empty string to nil for all args except 'image' and 'border'ifkey=="image"orkey=="border"orvalue~=""thenreturnvalueendendreturnnilend})--Call main functionreturnp.luaMain(frame,args)endfunctionp.luaMain(frame,args)localfunctionemp2nil(x)ifx==""thenreturnnilelsereturnxendendlocalfunctionspace2emp(x)ifstring.find(x,"^%s*$")thenreturn""elsereturnxendendlocalfunctionnopx(x)ifx~=niland(string.find(x,"^%d+$")orstring.find(x,"^%d+px$"))thenreturnstring.gsub(x,"^(.*)px","%1")elsereturnnilendend--Country & mode parameterslocalmode=string.lower(args[1]or"usc")localmi=string.sub(mode,1,1)localms=string.sub(mode,2,2)localmn=string.sub(mode,3,3)localme=string.sub(mode,4,-1)localcountry=args[2]or""localcountryDataCountry=countryifstring.find(me,"i")thenlocaltitleIocCountryData=mw.title.new[[Module:Country alias/data]]localIocCountryData=require(tostring(titleIocCountryData))localiocCountryAlias=IocCountryData.countryAliases[country]orcountrycountryDataCountry=IocCountryData.countries[iocCountryAlias]["countrydata_name"]orIocCountryData.countries[iocCountryAlias]["name"]endlocalavar=args["avar"]orargs["altvar"]localclink=args["clink"]orargs["link"]--Get country data & altvar datalocaldata,alink,amap,asufifavarthenlocalage=args["age"]or""localaaliasamap,aalias=require("Module:Flagg/Altvar data").alttable(age)avar=string.gsub(string.lower(avaror""),"[ -]","")avar=aalias[avar]oravarifnotamap[avar]thenerror("Unknown avar")endlocalapar={altvar=amap[avar].altvar;mw=amap[avar].mw;age=amap[avar].age;variant=args["variant"]orargs[3]}data=CountryData.getcachedtable(frame,countryDataCountry,apar)asuf=amap[avar].altlinkalink=data["link alias-"..amap[avar].altvar]or(clinkordata["shortname alias"]ordata.aliasorcountry).." "..asufelsedata=(args["nodata"]and{})orCountryData.getcachedtable(frame,countryDataCountry,{variant=args["variant"]orargs[3]})avar=""amap={[""]={altvar=""}}end--Name and link parametersclink=clinkordata.aliasorcountrylocalpref=args["pref"]localsuff=args["suff"]orasuflocalpref2=args["pref2"]localsuff2=args["suff2"]ifnotprefandnotsuffthen--Default prefixpref="Flag of"endlocalyn_map={[""]=0;["0"]=0;["no"]=0;["n"]=0;["1"]=1;["yes"]=1;["y"]=1}localfthe=(args["pthe"]andyn_map[args["pthe"]]~=0)or(args["the"]andyn_map[args["the"]]~=0)localnthe=(args["nthe"]andyn_map[args["nthe"]]~=0)or(args["the"]andyn_map[args["the"]]~=0)fthe=ftheand(prefand"t"or"T").."he "or""nthe=ntheand(prefand"t"or"T").."he "or""localflink=args["plink"]orargs["flink"]oralinkorclink==""and""orspace2emp((prefor"").." ")..fthe..clink..space2emp(" "..(suffor""))localflink2ifargs["plink2"]orargs["flink2"]orpref2orsuff2thenflink2=args["plink2"]orargs["flink2"]orclink==""and""orspace2emp((pref2or"").." ")..fthe..clink..space2emp(" "..(suff2or""))elseflink2=flinkendlocalfsec=args["psection"]orargs["section"]localfsec2=args["psection2"]orargs["section"]localcsec=args["csection"]orargs["section"]fsec=fsecand"#"..fsecor""fsec2=fsec2and"#"..fsec2or""csec=csecand"#"..csecor""ifstring.find(me,"f")thenifmw.title.new(flink).exists==falsethenifflink2~=flinkandmw.title.new(flink2).exists==truethenflink=flink2fsec=fsec2elseflink=clinkendendendlocalname=args["name"]ifnotnamethenlocalcname=string.find(me,"e")and(data["name alias-"..amap[avar].altvar]ordata["shortname alias"]ordata.alias)orcountryifmn=="f"thenname=cname==""and""orspace2emp((prefor"").." ")..nthe..cname..space2emp(" "..(suffor""))elsename=cnameendend--Image parameterslocalpimage=args["image"]localplaceholder="Flag placeholder.svg"localvariant=args["variant"]orargs[3]or""localimage_map={[""]=placeholder;["none"]=placeholder;["blank"]=placeholder}ifpimagethen--Remove namespacepimage=string.gsub(pimage,"^[Ff][Ii][Ll][Ee]:","")pimage=string.gsub(pimage,"^[Ii][Mm][Aa][Gg][Ee]:","")endlocaliname=image_map[pimage]orpimagelocalsize=args["size"]orargs["sz"]localsize_map={xs="12x8px";s="17x11px";m="23x15px";l="32x21px";xl="46x30px"}ifsize==nilorstring.find(size,"^%d*x?%d+px$")then--valid EIS size (..px, x..px or ..x..px) or unsetelseifstring.find(size,"^%d*x?%d+$")then--EIS size without "px" suffixsize=size.."px"else--size from map, or invalid valuesize=size_map[size]ornilendlocalborder=args["border"]ifinamethensize=sizeor"23x15px"ifyn_map[border]==0thenborder=""elseborder="|border"endelseiname=data["flag alias-"..amap[avar].altvar.."-"..variant]ordata["flag alias-"..variant]ordata["flag alias-"..amap[avar].altvar]ordata["flag alias"]orplaceholdersize=sizeoremp2nil(data.size)or"23x15px"ifborderthenifyn_map[border]==0thenborder=""elseborder="|border"endelselocalautoborder=data["border-"..variant]ordata["border-"..amap[avar].altvar]ordata.borderifautoborderandautoborder~="border"thenborder=""elseborder="|border"endendendlocalam=""ifargs["alt"]orstring.find(me,"a")thenam=args["alt"]orargs["name"]orcountryam=am.."|"..amend--Build display namelocaltext=args["text"]ifnottextthenifmn=="x"then--no texttext=""elseifmn=="p"ormn=="f"ormn=="*"then--prefix/suffix linktext=flink==""andnameor"[["..flink..fsec.."|"..name.."]]"-- By the principle of least surprise, there should be some-- indication that the link [[X of Country|Country]] does not-- go to [[Country]].ifmn=="*"andclink~=flinkthentext=text:sub(1,-3).."\226\128\175*]]"endelseifmn=="l"then--display link targettext=flink==""andnameor"[["..flink..fsec.."|"..(args["name"]orflink).."]]"elseifmn=="b"then--both prefix/suffix and normal country linklocalpreflink=prefand(flink==""andpref.." "or"[["..flink..fsec.."|"..pref.."]] ")or""localsufflink=suffand(flink==""and" "..suffor" [["..flink..fsec.."|"..suff.."]]")or""localnamelink=(name==""and""ornthe)..(clink==""andnameor"[["..clink..csec.."|"..name.."]]")text=preflink..namelink..sufflinkelseifmn=="d"then--data templatelocaltitle=mw.title.new("Template:Country data "..country)--check if redirectiftitle.isRedirectthentext="<span class=\"plainlinks\">["..title:fullUrl("redirect=no").." "..name.."]</span>"elsetext="[["..title.fullText.."|"..name.."]]"endelseifmn=="u"then--unlinkedtext=nameelseifmn=="a"then--abbrtext=name==countryand(clink==countryandcountryor"<abbr title='"..clink.."'>"..country.."</abbr>")or("<abbr title='"..name.."'>"..country.."</abbr>")else--country link (default)text=clink==""andnameor"[["..clink..csec.."|"..name.."]]"endifstring.find(me,"p")thentext="("..text..")"endendiftype(text)=='function'thentext=text(data)end--Define separatorlocalseparator=" "--non-breaking space (n)ifms=="x"then--no separatorseparator=""elseifms=="l"then--line breakseparator="<br />"end--Add preftext, if usedlocalpreftext=args["preftext"]if(preftextor"")~=""thentext=preftext..separator..textend--Build imagelocalilink=args["ilink"]ifnotilinkthenifmi=="x"or(iname==placeholderandpimage~=placeholder)then--no image/invisible imageiname=placeholderborder=""ilink="|link="am=""elseifmi=="i"then--image page linkilink=""elseifmi=="c"then--country linkilink="|link="..clink..(clink==""and""orcsec)elseifmi=="p"ormi=="f"then--prefix/suffix linkilink="|link="..flink..(flink==""and""orfsec)elseifmi=="d"then--data templatelocaltitle=mw.title.new("Template:Country data "..country)--check if redirectiftitle.isRedirectthenilink="|link="..title:fullUrl("redirect=no")elseilink="|link="..title.fullTextendelse--unlinked (default)ilink="|link="endendifam==""andstring.find(me,"l")thenam=mw.ustring.sub(ilink,7,-1)endlocalimage="[[File:"..iname.."|"..size..border..ilink.."|alt="..am.."]]"ifiname==placeholderthenifrequire('Module:yesno')(args["noredlink"])==falseorargs["noredlink"]=="notext"thenifcountry~=''anddata.alias==niltheniname=''image="[[:Template:Country data "..country.."]]"ifargs["noredlink"]=="notext"thentext=''endendendif(args["missingcategory"]or'')~=''thenimage=image..args["missingcategory"]endifstring.find(me,"b")thentext=''endend--Combine image and name with separatorlocalalign_map={left="left",l="left",center="center",centre="center",c="center",middle="center",m="center",right="right",r="right"}localalign=align_map[args["align"]orargs["al"]]localnalign=align_map[args["nalign"]orargs["nal"]]localoutifstring.find(me,"r")then--image right of nameif(ms=="x"andmi=="x")or(string.find(me,"o")andiname==placeholderandpimage~=placeholder)then--name onlyout=textelseifms=="x"orms=="n"orms=="l"then--no separator, non-breaking space, or line breakout=text.."<span class=\"flagicon\">"..separator..image.."</span>"elseifms=="t"then--table cellout="style=\"text-align:"..(nalignor"left").."\"|"..text.."||style=\"text-align:"..(alignor"center").."\"|<span class=\"flagicon\">"..image.."</span>"else--fixed-width span box (default)localwidth=args["width"]orargs["w"]orrequire("Module:Flaglist").luawidth(size)out=text.." <span class=\"flagicon\" style=\"display:inline-block;width:"..width.."px;text-align:"..(alignor"right").."\">"..image.."</span>"endelse--image left of nameif(ms=="x"andmi=="x")or(string.find(me,"o")andiname==placeholderandpimage~=placeholder)then--name onlyout=textelseifms=="x"orms=="n"orms=="l"then--no separator, non-breaking space, or line breakout="<span class=\"flagicon\">"..image..separator.."</span>"..textelseifms=="t"then--table cellout="style=\"text-align:"..(alignor"center")..";\"|<span class=\"flagicon\">"..image.."</span>||style=\"text-align:"..(nalignor"left").."\"|"..textelse--fixed-width span box (default)localwidth=nopx(args["width"]orargs["w"])orrequire("Module:Flaglist").luawidth(size)out="<span class=\"flagicon\" style=\"display:inline-block;width:"..width.."px;text-align:"..(alignor"left").."\">"..image.."</span> "..textendendifstring.find(me,"w")then--avoid wrappingout="<span class=\"nowrap\">"..out.."</span>"end-- align in tableifme:find("t")thenout='style="text-align:'..(alignor'left')..'"|'..outend--Tracking categorieslocalcat=""ifpimageandnotimage_map[pimage]andcountry~=""anddata["flag alias"]andnotargs.demothencat="[[Category:Pages using Flagg with specified image instead of data template image]]"endreturnout..catendreturnp