Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Validextension/doc: Difference between revisions

Template page
m format
m format
Line 4: Line 4:
|1stat=required
|1stat=required
|2=2
|2=2
|2d=the name of the file without namespace and dot_extension, e.g.<br>
|2d=the name of the file without namespace and without dot_extension, e.g.<br>
<nowiki>{{#invoke:StripFilename|main|</nowiki>''filename''<nowiki>}}</nowiki><br>
<nowiki>{{#invoke:StripFilename|main|</nowiki>''filename''<nowiki>}}</nowiki><br>
<nowiki>{{#invoke:File|woExtension|file=</nowiki>''filename''<nowiki>}}</nowiki><br>
<nowiki>{{#invoke:File|woExtension|file=</nowiki>''filename''<nowiki>}}</nowiki><br>
<nowiki>{{#invoke:FileName|removeExtension}}</nowiki>
<nowiki>{{#invoke:FileName|removeExtension|</nowiki>''filename''<nowiki>}}</nowiki><br>
<small>or the result of such a function</small>
<small>or the result of such a function</small>
|2stat=required
|2stat=required

Revision as of 14:18, 15 March 2015

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

ParameterDescriptionDefaultStatus
1file name: name of the file without namespace (e.g. PAGENAMEd)emptyrequired
2the name of the file without namespace and without dot_extension, e.g.

{{#invoke:StripFilename|main|filename}}
{{#invoke:File|woExtension|file=filename}}
{{#invoke:FileName|removeExtension|filename}}

or the result of such a function
emptyrequired
3"Extension" when the valid extension should be returned ("e" is enough)emptyoptional

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
Cookies help us deliver our services. By using our services, you agree to our use of cookies.