Jump to content

Template:Extension/Sample: Difference between revisions

From mediawiki.org
Content deleted Content added
Jpond (talk | contribs)
Added imagesize, tags, and compatibility to correspond with Template:Extension
Default {{ExtensionInstall}} to use registration, because its 2024
 
(36 intermediate revisions by 19 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 =
|php =
|version =
|license = <!-- what license your extension is released under -->
|update =
|download =
|version preview =
|readme =
|update preview =
|compatibility policy =
|changelog =
|parameters = <!-- configuration parameters, for use in LocalSettings.php -->
|mediawiki = <!-- only needed if different from what's in extension.json -->
|rights = <!-- user rights, for use with $wgGroupPermissions -->
|php =
|example =
|needs-updatephp =
|composer =
}}
|table1 =
{{Extension|templatemode=
|name =
|table2 =
|license = <!-- what license your extension is released under -->
|status = beta
|download = <includeonly>{{WikimediaDownload|{{subst:SUBPAGENAME}}}}</includeonly>
|type1 = <!-- implementation type, see [[Template:Extension]] for details. -->
|readme = <includeonly>{{git file|project=mediawiki/extensions/{{subst:SUBPAGENAME}}|file=README|branch=HEAD|text=README}}</includeonly>
|type2 =
|changelog =
|hook1 = <!-- default/custom hooks used, see [[Template:Extension]] for details -->
|help = <!-- automatically links to Help:Extension:ExtName if it exists, otherwise enter full wikitext link to end-user docs -->
|hook2 =
|username = <!-- optional, but strongly recommended -->
|example =
|author = <!-- add only if different from user name -->
|namespace =
|description = <!-- brief description of purpose/use case -->
|parameters = <!-- configuration parameters, for use in LocalSettings.php -->
|image =
|tags =
|rights = <!-- user rights, for use with $wgGroupPermissions -->
|imagesize =
|version =
|compatibility =
|update =
|phabricator =
|mediawiki =
|vagrant-role =
|php =
|license = <!-- what license your extension is released under -->
|download =
|readme =
|changelog =
|parameters = <!-- configuration parameters, for use in LocalSettings.php -->
|tags =
|rights = <!-- user rights, for use with $wgGroupPermissions -->
|example =
|compatibility =
}}
}}


The '''<includeonly>{{subst:SUBPAGENAME}}</includeonly><noinclude>MyExtension</noinclude>''' extension does foo.


==Installation==


{{ExtensionInstall|registration=true}}
==What can this extension do?==

==Usage==

==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 applicable. 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]