![]() | This is a documentation subpage for Template:Userscript. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used to create userscript listings, primarily for use at Wikipedia:User scripts, but it can be used on any page.
Usage
{{ userscript |name= [script name] |code= [.js address] |doc= [documentation page address] }}
All parameters are optional except for "name", however the template is not of much use without at least a .js path or a documentation path.
Example: {{userscript|name=Sharebox|code=User:TheDJ/sharebox.js|doc=User:TheDJ/Sharebox}}
Produces: Sharebox[1] (source)
- If a documentation page exists with a name that matches the code page name (without its .js extension), that documentation page will be linked automatically, with no
|doc=
parameter required. - You can still enter a
|doc=
parameter explicitly if you want to override the automatic link.
Example: {{userscript|name=Sharebox|code=User:TheDJ/sharebox.js}}
Produces: Sharebox[2] (source)
Additional parameter
This template enables automatic installation for editors who use User:Equazcion/ScriptInstaller. To disable automatic installation, use the following parameter:
|noautoinstall=yes
- ^ Copy the following code, edit your user JavaScript, then paste:
{{subst:lusc|1=User:TheDJ/sharebox.js}}
- ^ Copy the following code, edit your user JavaScript, then paste:
{{subst:lusc|1=User:TheDJ/sharebox.js}}