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
format
 
m format
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
|1stat=required
|1stat=required
|2=2
|2=2
|2d=<nowiki>{{#invoke:File|woExtension|file=</nowiki>''filename''<nowiki>}}</nowiki>
|2d=the name of the file without namespace and without dot_extension, e.g.<br>
<small>or the result of this function</small>
<nowiki>{{#invoke:StripFilename|main|</nowiki>''filename''<nowiki>}}</nowiki><br>
<nowiki>{{#invoke:File|woExtension|file=</nowiki>''filename''<nowiki>}}</nowiki><br>
<nowiki>{{#invoke:FileName|removeExtension|</nowiki>''filename''<nowiki>}}</nowiki><br>
:<small>or the result of such a function</small>
|2stat=required
|2stat=required
|3=3
|3=3
|3d="Extension" when the valid extension should be returned ("e" is enough)  
|3d="Extension" when the valid extension should be returned ("e" is enough)  
|3stat=optional-  
|3stat=optional-  
|4=4
|4d=default value for extension to be returned when invalid extension
|4stat=optional-


|name=Validextension
|name=Validextension
Line 16: Line 22:
|usergroup=all
|usergroup=all
|i18n-desc=The template does not generate any localizable text.
|i18n-desc=The template does not generate any localizable text.
|i18n-method=-
|usage-notes=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.  
|usage-notes=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.  
}}
}}
Line 23: Line 30:
*3=e: the file extension, if it is a valid one, otherwise a null string
*3=e: the file extension, if it is a valid one, otherwise a null string
*otherwise: the file name without dot_extension
*otherwise: the file name without dot_extension
=== Examples ===
{|
|-
|<nowiki>{{Validextension|HSWikimedia.svg|HSWikimedia||???}}</nowiki>
|{{Validextension|HSWikimedia.svg|HSWikimedia||???}}
|-
|<nowiki>{{Validextension|HSWikimedia.svg|HSWikimedia|e|???}}</nowiki>
|{{Validextension|HSWikimedia.svg|HSWikimedia|e|???}}
|-
|<nowiki>{{Validextension|HSWikimedia.icon|HSWikimedia||''unknown ext''}}</nowiki>
|{{Validextension|HSWikimedia.icon|HSWikimedia||''unknown ext''}}
|-
|<nowiki>{{Validextension|HSWikimedia.icon|HSWikimedia|e|''unknown ext''}}</nowiki>
|{{Validextension|HSWikimedia.icon|HSWikimedia|e|''unknown ext''}}
|-
|<nowiki>{{Validextension|HSWikimedia.icon|HSWikimedia}}</nowiki>
|{{Validextension|HSWikimedia.icon|HSWikimedia}}
|-
|<nowiki>{{Validextension|HSWikimedia.icon|HSWikimedia|e}}</nowiki>
|{{Validextension|HSWikimedia.icon|HSWikimedia|e}}
|}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.