Module:Check for unknown parameters/doc: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
m (rv-v) |
|||
Line 7: | Line 7: | ||
== Usage == |
== Usage == |
||
=== Basic usage === |
=== Basic usage === |
||
<pre> |
<pre> |
||
{{#invoke:check for unknown parameters|check |
{{#invoke:check for unknown parameters|check |
||
|unknown=[[Category:Some tracking category]] |
|unknown=[[Category:Some tracking category]] |
||
|arg1|arg2|...|argN}} |
|arg1|arg2|...|argN}} |
||
</pre> |
</pre> |
||
or to sort the entries in the tracking category by parameter with a preview error message |
or to sort the entries in the tracking category by parameter with a preview error message |
||
<pre> |
<pre> |
||
{{#invoke:check for unknown parameters|check |
{{#invoke:check for unknown parameters|check |
||
|unknown=[[Category:Some tracking category|_VALUE_]] |
|unknown=[[Category:Some tracking category|_VALUE_]] |
||
|preview=unknown parameter "_VALUE_" |
|preview=unknown parameter "_VALUE_" |
||
|arg1|arg2|...|argN}} |
|arg1|arg2|...|argN}} |
||
</pre> |
</pre> |
||
or for an explicit red error message |
or for an explicit red error message |
||
<pre> |
<pre> |
||
{{#invoke:check for unknown parameters|check |
{{#invoke:check for unknown parameters|check |
||
|unknown=<span class="error">Sorry, I don't recognize _VALUE_</span> |
|unknown=<span class="error">Sorry, I don't recognize _VALUE_</span> |
||
|arg1|arg2|...|argN}} |
|arg1|arg2|...|argN}} |
||
</pre> |
</pre> |
||
Here, <code>arg1</code>, <code>arg2</code>, ..., <code>argN</code>, are the known parameters. Unnamed (positional) parameters can be added too: <code><nowiki>|1|2|argname1|argname2|...</nowiki></code>. Any parameter which is used, but not on this list, will cause the module to return whatever is passed with the <code>unknown</code> parameter. The <code>_VALUE_</code> keyword, if used, will be changed to the name of the parameter. This is useful for either sorting the entries in a tracking category, or for provide more explicit information. |
Here, <code>arg1</code>, <code>arg2</code>, ..., <code>argN</code>, are the known parameters. Unnamed (positional) parameters can be added too: <code><nowiki>|1|2|argname1|argname2|...</nowiki></code>. Any parameter which is used, but not on this list, will cause the module to return whatever is passed with the <code>unknown</code> parameter. The <code>_VALUE_</code> keyword, if used, will be changed to the name of the parameter. This is useful for either sorting the entries in a tracking category, or for provide more explicit information. |
||