编辑“︁
Template:Flagg/doc
”︁(章节)
跳转到导航
跳转到搜索
这是
Flagg
模板的
文档页面
。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
=== 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 <code>i</code>, <code>i**</code> or <code>izz</code> will be read as <code>isc</code>. '''First letter: Image''' {|class="wikitable" ! Letter !! Meaning !! Description !! Example |- | <code>u</code> || <u>u</u>nlinked || Image is not linked (default). || {{#invoke:DemoTemplate|flagg|uxx|France}} |- | <code>c</code> || <u>c</u>ountry || Image links to country/entity page. || {{#invoke:DemoTemplate|flagg|cxx|France}} |- | <code>p</code> [<code>f</code>] || <u>p</u>refix/suffix || Image links to country name with prefixed and/or suffixed text (default "Flag of ..."), set using {{para|pref}} and {{para|suff}} (see [[#pref|below]]). || {{#invoke:DemoTemplate|flagg|pxx|France}} |- id="i" | <code>i</code> || <u>i</u>mage page || Image links to file description page; use this for non-public-domain images, for which attribution is required. || {{#invoke:DemoTemplate|flagg|ixx|France}} |- | <code>d</code> || <u>d</u>ata template || Image links to the used country data template, for use in discussion/documentation. Automatically adds <code>redirect=no</code> if link is a redirect. || {{#invoke:DemoTemplate|flagg|dxx|France}} |- id="x" | <code>x</code> || [[X mark]] || No image is displayed. If the second letter is anything other than <code>x</code>, and [[#o|<code>o</code>]] is not set, an unlinked transparent image is actually used to preserve the spacing. || {{#invoke:DemoTemplate|flagg|xnx|France}} |} '''Second letter: Separator''' {|class="wikitable" ! Letter !! Meaning !! Description !! colspan="2"|Example |- id="s" | <code>s</code> || <u>s</u>pan box || The flag image is put in a fixed-width <span> tag, meaning the country names are aligned in vertical lists; see documentation of {{tl|Flaglist}} (default). || colspan="2"|{{#invoke:DemoTemplate|flagg|usu|Niger}} |- id="n" | <code>n</code> || <u>n</u>on-breaking space || A non-breaking space (<code>&nbsp;</code>) is used, like in most flag templates, including {{tl|flag}}. Note that &nbsp; does not actually prevent wrapping between image and text in all browsers; use [[#w|<code>w</code>]] as described below if needed. || colspan="2"|{{#invoke:DemoTemplate|flagg|unu|Niger}} |- id="l" | <code>l</code> || <u>l</u>ine break || A line break (<code><br/></code>) is used as separator. || colspan="2"|{{#invoke:DemoTemplate|flagg|ulu|Niger}} |- id="t" | <code>t</code> || <u>t</u>able cell || A table cell separator (two pipes) is used. || {{#invoke:DemoTemplate|flagg|utu|Niger}} |- | <code>x</code> || X mark || No separator is used. || colspan="2"|{{#invoke:DemoTemplate|flagg|uxu|Niger}} |} '''Third letter: Name''' {|class="wikitable" ! Letter !! Meaning !! Description !! Example |- | <code>c</code> || <u>c</u>ountry || The country name links to the main country/entity page (default). || {{#invoke:DemoTemplate|flagg|xxc|Chile}} |- | <code>p</code> || <u>p</u>refix/suffix || The country name links to the country page with prefixed or suffixed text (default "Flag of ..."), set using {{para|pref}} and {{para|suff}} (see [[#pref|below]]). || {{#invoke:DemoTemplate|flagg|xxp|Chile}} |- id="f" | <code>f</code> || <u>f</u>ull prefix/suffix || Same as <code>p</code>, except that the prefix and/or suffix is/are displayed. || {{#invoke:DemoTemplate|flagg|xxf|Chile}} |- id="b" | <code>b</code> || <u>b</u>oth 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. || {{#invoke:DemoTemplate|flagg|xxb|Chile}} |- | <code>u</code> || <u>u</u>nlinked (cf. {{tl|flagu}}) || The country name is displayed as plain text, without link. || {{#invoke:DemoTemplate|flagg|xxu|Chile}} |- | <code>d</code> || <u>d</u>ata template || Country name is linked to the used country data template, for use in discussion/documentation. Automatically adds <code>redirect=no</code> if a redirect is used. || {{#invoke:DemoTemplate|flagg|xxd|Chile}} |- | <code>x</code> || X mark || No text is displayed. || {{#invoke:DemoTemplate|flagg|xxx|Chile}} |- | <code>*</code> || Add * || Similar to "p", except that an asterisk (*) is added to the text of the link if it goes to a more specific article.|| {{#invoke:DemoTemplate|flagg|xx*|Chile}} |} Some additional options can be enabled by appending the following letters to the three-letter code in any order: {| class="wikitable" ! Letter !! Description !! Example |- id="a" | <code>a</code> || <u>A</u>dds the country name (the "name" parameter, or if unset the second unnamed parameter) as <u>a</u>lt text and mouseover for the image. If [[#alt|{{para|alt}}]] is used for a custom alt/mouseover text, this does not need to be separately set. || {{#invoke:DemoTemplate|flagg|uxxa|Pakistan}} |- | <code>b</code> || <u>B</u>lanks the text portion if a flag is not found. || {{#invoke:DemoTemplate|flagg|uncb|Xanadu}}<br/>Compare with:<br/>{{#invoke:DemoTemplate|flagg|unc|Xanadu}} |- id="e" | <code>e</code> || Uses the name set in the country data template (rather than the first parameter) as display name, like in {{tl|flagcountry}} (i.e. <u>e</u>xpands abbreviated forms). || {{#invoke:DemoTemplate|flagg|unue|PAK}} |- id="f" | <code>f</code> || If the prefixed/suffixed article name doesn't exist, <u>f</u>allback to linking to the non-prefixed/suffixed page. This may be [[:mw:Help:Extension:ParserFunctions#ifexist_limits|expensive]], and the number of time it can be used on single page is limited. || {{#invoke:DemoTemplate|flagg|psff|Egypt|pref=Flag templates in}}<br/>Compare with:<br/>{{#invoke:DemoTemplate|flagg|psf|Egypt|pref=Flag templates in}} |- id="o" | <code>l</code> || Adds the <u>l</u>ink name (as defined by the "image" parameter) as alt text and mouseover for the image. If [[#alt|{{para|alt}}]] is used for a custom alt/mouseover text, this does not need to be separately set. || {{#invoke:DemoTemplate|flagg|cxxl|PAK}}<br/>Compare with:<br/>{{#invoke:DemoTemplate|flagg|cxxa|PAK}} |- | <code>o</code> || <u>O</u>mits 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. || {{#invoke:DemoTemplate|flagg|unuo|Pakistan|image=}}<br/>Compare with:<br/>{{#invoke:DemoTemplate|flagg|unu|Pakistan|image=}} |- id="r" | <code>r</code> || Reverses the order of the elements, putting the image to the <u>r</u>ight of the name; cf. {{tl|flagright}}. Doesn't affect the order of letters in the format code. || {{#invoke:DemoTemplate|flagg|uncr|Pakistan}} |- id="w" | <code>w</code> || Avoids <u>w</u>rapping by adding {{tag|span|params=class="nowrap"}} around the output. || {{#invoke:DemoTemplate|flagg|unuw|Pakistan}} |- id="t" | <code>t</code> || Aligns to the left in a <u>t</u>able. || |}
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模板
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息