Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Compact list/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Module rating|protected}} ==Usage== Lua code for inside of another template (e.g., an infobox). Creates a compact list out of a set of named arguments. For example, if the argument to this module is "foo", it searches for all arguments named "foo" followed by an optional underscore followed by one or more digits. It then assembles all of the named argument into a "pretty printed" list, in numerical order. If the list is short (<= 4 long), the module uses {{tl|enum}} to print in the "A, B, C or D" format. If it is long, it will use {{tl|collapsible list}}. The threshold can be set with {{para|_limit}}. Typical usage in a parent template, which gathers all arguments named "foo": <code><nowiki>{{#invoke:Compact list|main|foo|_limit=4}}</nowiki></code> ===Examples=== '''Note:''' these examples have the named arguments passed to the module directly. In practice, these named arguments would be passed to the template that invokes the module. <code><nowiki>{{#invoke:Compact list|main|ook|ook=A|spud=1234}}</nowiki></code> β A <code><nowiki>{{#invoke:Compact list|main|ook|ook1=A|ook_2=B}}</nowiki></code> β {{enum|A|B}} <code><nowiki>{{#invoke:Compact list|main|ook|ook=A|ook1=B|ook2=C|ook3=D}}</nowiki></code> β {{enum|A|B|C|D}} <code><nowiki>{{#invoke:Compact list|main|ook|ook1=A|ook5=B|ook20=C|ook3000=D|ook342345=E|foofoofoo=234}}</nowiki></code> β {{collapsible list|A|B|C|D|E}} <code><nowiki>{{#invoke:Compact list|main|ook|ook1=A|ook5=B|ook20=C|ook3000=D|ook342345=E|foofoofoo=234|_limit=5}}</nowiki></code> β {{enum|A|B|C|D|E}} <code><nowiki>{{#invoke:Compact list|main|ook|ook=A|ook1=B|ook2=C|ook3=D|ook4=E|ook5=F|ook6=G}}</nowiki></code> β {{collapsible list|A|B|C|D|E|F|G}}
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Collapsible list
(
edit
)
Template:Enum
(
edit
)
Template:Module rating
(
edit
)
Template:Para
(
edit
)
Template:Tl
(
edit
)
Module:Collapsible list
(
edit
)