Module:Flag/doc: Difference between revisions
From EunuchWiki
→Examples: frameonly |
m 1 revision imported |
||
(No difference)
|
Latest revision as of 19:03, 31 March 2024
Warning | This Lua module is used on approximately 307,000 pages, or roughly 7937% of all pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
File:Lua-Logo.svg | This module depends on the following other modules: |
Lua-native alternative to popular flag templates. Can be used to reduce post-expand include size of pages with lots of templates, since it avoids calling multilevel templates.
Usage
- {{flag}} → {{#invoke:flag|}}
- {{flagcountry}} → {{#invoke:flag|country}}
- {{flagdeco}} → {{#invoke:flag|deco}}
- {{flagicon}} → {{#invoke:flag|icon}}
- {{flag+link}} → {{#invoke:flag|+link}}
- {{flagathlete}} → {{#invoke:flag|athlete}}
- {{flagmedalist}} → {{#invoke:flag|medalist}}
Examples
Caveats
When used inside a template, parameters from that template are passed to the module. This can be useful in some situations, but can lead to conflicts (for example, if the parent template has a parameter |country=
that is unrelated to the flag it is supposed to display). To prevent this behavior, add the |frameonly=
parameter to the module call, e.g. {{#invoke:flag|deco|CHN|frameonly=true}}
.