မေႃႇၵျူး:checkparams/doc

လုၵ်ႉတီႈ ဝိၵ်ႇသျိၼ်ႇၼရီႇ မႃး

This is the documentation page for မေႃႇၵျူး:checkparams

Editor info[မႄးထတ်း]

If you're seen a warning that "The template does not use the parameter(s)" while editing a page, the error was generated by this module. This module can detect all of the parameters that are used by a template and will generate a warning when using an unexpected parameter. In many cases, the error might be generated by a typo in the parameter name (eg, "pge" instead of "page") and can simply be corrected by consulting the template's documentation. If you're absolutely certain that a template should allow the parameter even though it's not going to actually use the parameter, you can override the automatic parameter detection by adding a | plus a comma separated list to the {{#invoke:checkparams|warn}} or the {{#invoke:checkparams|error}} line at the top of the template.

For example, to allow parameters "3" and "comment" in the following template

{{#invoke:checkparams|warn}}<!-- Validate template parameters
-->Written by {{{1}}} and {{{2}}} in {{{year}}}

change it to:

{{#invoke:checkparams|warn|1,2,3,year,comment}}<!-- Validate template parameters
The parameters '3' and 'comment' are not used, but are explicitly allowed because ....
-->Written by {{{1}}} and {{{2}}} in {{{year}}}

Note that you must list every valid parameter

Developer information[မႄးထတ်း]

This module generates warnings when passing bad parameters to a template. It adds a user-visible warning to the preview, an {{attention}} warning to the page, and categorizes the page into Category:Pages using bad params when calling a template

warn[မႄးထတ်း]

  • The |1= (optional) a comma separated list of allowed parameters. If not provided, the module will scan the template and allow all parameters used by the template.
  • The |nocat= (optional) if provided, does not add page to categories