Jump to content

Template:Extension/Sample: Difference between revisions

From mediawiki.org
Content deleted Content added
No edit summary
Default {{ExtensionInstall}} to use registration, because its 2024
 
(39 intermediate revisions by 21 users not shown)
Line 1: Line 1:
<!---
<!--
**************************************************************
**************************************************************
Usage instructions:
Usage instructions:
1. Fill in the template. For help, see [[Template:Extension]].
1. REMOVE THE TAG line above this box
2. Remove any HTML comments from the infobox after you are finished.
IT WILL PREVENT PROPER DISPLAY OF THE INFOBOX.

2. Fill in the template. For help, see [[Template:Extension]]
3. Remove this comment when you no longer need it.
3. Remove this comment when you no longer need it.
**************************************************************
**************************************************************
--->
-->
<languages/>

{{Extension|templatemode=
{{Extension|templatemode = <noinclude>nocats</noinclude>
|name = <includeonly>{{subst:SUBPAGENAME}}</includeonly><noinclude>MyExtension</noinclude>
|name =
|status = beta
|status = beta
|type1 = <!-- implementation type, see [[Template:Extension]] for details. -->
|type1 = <!-- implementation type, see [[Template:Extension]] for details -->
|type2 =
|type2 =
|hook1 = <!-- default/custom hooks used, see [[Template:Extension]] for details -->
|hook1 = <!-- default / custom hooks used, see [[Template:Extension]] for details -->
|hook2 =
|hook2 =
|newhook1 = <!-- hooks added by the extension, see [[Template:Extension]] for details -->
|username = <!-- optional, but strongly recommended -->
|author = <!-- add only if different from user name -->
|newhook2 =
|description = <!-- brief description of purpose/use case -->
|username = <!-- optional, but strongly recommended -->
|author = <!-- add only if different from user name -->
|image =
|description = <!-- brief description of purpose / use case -->
|version =
|update =
|image =
|mediawiki =
|imagesize =
|license = <!-- what license your extension is released under -->
|version =
|download =
|update =
|readme =
|version preview =
|changelog =
|update preview =
|compatibility policy =
|parameters = <!-- configuration parameters, for use in LocalSettings.php -->
|rights = <!-- user rights, for use with $wgGroupPermissions -->
|mediawiki = <!-- only needed if different from what's in extension.json -->
|example =
|php =
|needs-updatephp =
|composer =
|table1 =
|table2 =
|license = <!-- what license your extension is released under -->
|download = <includeonly>{{WikimediaDownload|{{subst:SUBPAGENAME}}}}</includeonly>
|readme = <includeonly>{{git file|project=mediawiki/extensions/{{subst:SUBPAGENAME}}|file=README|branch=HEAD|text=README}}</includeonly>
|changelog =
|help = <!-- automatically links to Help:Extension:ExtName if it exists, otherwise enter full wikitext link to end-user docs -->
|example =
|namespace =
|parameters = <!-- configuration parameters, for use in LocalSettings.php -->
|tags =
|rights = <!-- user rights, for use with $wgGroupPermissions -->
|compatibility =
|phabricator =
|vagrant-role =
}}
}}


The '''<includeonly>{{subst:SUBPAGENAME}}</includeonly><noinclude>MyExtension</noinclude>''' extension does foo.
==What can this extension do?==


==Usage==
==Installation==


{{ExtensionInstall|registration=true}}
==Download instructions==
<!-- revise these instructions if code is available via a download site -->
Please cut and paste the code found [[#Code|below]] and place it in <code>$IP/extensions/ExtensionName/ExtensionName.php</code>. ''Note: [[Manual:$IP|$IP]] stands for the root directory of your MediaWiki installation, the same directory that holds [[Manual:LocalSettings.php|LocalSettings.php]]''.

==Installation==
To install this extension, add the following to [[Manual:LocalSettings.php|LocalSettings.php]]:
<source lang="php">
#add configuration parameters here
#setup user rights here
require_once("$IP/extensions/ExtensionName/ExtensionName.php");
</source>


===Configuration parameters===
==Configuration parameters==
{{ParameterList}} <!-- If your extension is in Wikimedia Gerrit, a bot will automatically fill this out for you -->
<!-- Explain the purpose of each configuration parameter provided to Template:Extension -->
<!--
Explain the purpose of each configuration parameter provided to Template:Extension.
;$wgMyExtensionFoo: Some description.
;$wgMyExtensionBar: Some description.


-->
===User rights===
<!-- Explain the purpose of each user right provided to Template:Extension -->


==Code==
==User rights==
<!--
<!-- delete this section if code is available via a download site -->
Explain the meaning of each user right provided to Template:Extension.
<source lang="php">
-->
<!-- put your code here - note that the ending ?> tag should not be present, as it's not needed and is likely to cause only problems. This has been since MediaWiki 1.11 and newer releases. -->
</source>


==See also==
==See also==
<!-- add other related extensions here, if appliable. If not, just delete this comment and the see also-header. -->
<!-- Add other related extensions here, if applicable. If not, just delete this comment and the "See also" header. -->
<noinclude>__EXPECTUNUSEDTEMPLATE__</noinclude>

Latest revision as of 03:30, 11 September 2024


MediaWiki extensions manual
MyExtension
Release status: beta
License No license specified
Download No link
Translate the Extension/Sample extension if it is available at translatewiki.net

The MyExtension extension does foo.

Installation

[edit]
  • Download and move the extracted Extension folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Extension
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Extension' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters

[edit]

User rights

[edit]

See also

[edit]