Open main menu

Changes

add links to tracking categories
{{High-use|233415}}
{{Lua|Module:Category handler|Module:Arguments|Module:Color contrast}}

This module does the processing for three userbox templates, {{tl|userbox}}, {{tl|userbox-2}} and {{tl|userbox-r}}.

{| class="wikitable"
|-
! Template
! Description
! Examples
|-
| {{tl|userbox}}
| Makes userboxes with an id on the left-hand side, or with no id.
| {{userbox|id=id}}
{{clear}}
{{userbox}}
|-
| {{tl|userbox-2}}
| Makes userboxes with an id on both the left- and right-hand sides.
| {{userbox-2}}
|-
| {{tl|userbox-r}}
| Makes userboxes with an id on the right-hand side.
| {{userbox-r}}
|}

To use any of these templates from a wiki page, please see the individual template pages for documentation. To generate userboxes directly from Lua, read on.

== Generating userboxes from Lua ==

To generate a userbox directly from Lua, first load the module.

<source lang="lua">
local userbox = require('Module:Userbox')
</source>

You can then run any of the three templates with the code:

<source lang="lua">
userbox.main(functionName, args)
</source>

For {{tl|userbox}} use the function name "<code>_userbox</code>"; for {{tl|userbox-2}} use the function name "<code>_userbox-2</code>"; and for {{tl|userbox-r}} use the function name "<code>_userbox-r</code>". The <code>args</code> parameter is a table of arguments to pass to the different userbox functions. To see a list of valid arguments, please consult the individual template pages.

== Tracking categories ==
* {{clc|Potentially illegible userboxes}}
* {{clc|Pages with misplaced templates}}
Anonymous user