Template:Validextension/doc
Template page
More actions
Postprocessor template to check the output of Module:File.
Usage
{{Validextension |1= |2= }}
As long the module does not distinguish between valid extensions and other cruft, this template can be used to verify the output of the module.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | file name: name of the file without namespace (e.g. PAGENAMEd) | empty | required | |
2 | the name of the file without namespace and dot_extension, e.g. {{#invoke:StripFilename|main|filename}} | empty | required | |
3 | "Extension" when the valid extension should be returned ("e" is enough) | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: the File namespace
The template is intended to be used by the following user groups: all users == Localization ==
The template does not generate any localizable text.
Explanation
Depending on the third parameter, it returns either
- 3=e: the file extension, if it is a valid one, otherwise a null string
- otherwise: the file name without dot_extension