Misplaced Pages

Module:Params/doc/examples/check for unknown parameters/doc

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Module:Params | doc | examples | check for unknown parameters
This is a documentation subpage for Module:Params/doc/examples/check for unknown parameters.
It may contain usage information, categories and other content that is not part of the original module page.

This example template shows to use {{#invoke:params|discarding|...}} to check for unknown parameters.

Usage

For instance, writing

{{module:params/doc/examples/check for unknown parameters
	| hello = world
	| wind = surfing
}}

will generate

Everything is good: do something

while writing

{{module:params/doc/examples/check for unknown parameters
	| hello = world
	| wind = surfing
	| wrong = ups!
}}

will generate

Error: The only parameters accepted are |hello= and |wind=.

For simple cases like this specialized modules are available; you might want to have a look at: