[[<tvar|1>Special:MyLanguage/Phabricator|Phabricator]] project: [[phab:tag/{{{phabricator}}}/|#{{{phabricator}}}]]

Difference between revisions of "Template:Extension"

From RobotX
Jump to navigation Jump to search
m (Text replacement - "<!--T:(.*)-->" to "")
m (Text replacement - "<tvar|1>" to "")
 
(2 intermediate revisions by the same user not shown)
Line 152: Line 152:
 
{{#if:{{{needs-updatephp|{{#invoke:Extension|getNeedsUpdates}}}}}|
 
{{#if:{{{needs-updatephp|{{#invoke:Extension|getNeedsUpdates}}}}}|
 
<tr>
 
<tr>
<td>{{ll|Template:Extension#needs-updatephp|2=<abbr title=" <tvar|com>'php update.php'</> needed after installation">''' Database changes'''</abbr>}}</td>
+
<td>{{ll|Template:Extension#needs-updatephp|2=<abbr title=" <tvar|com>'php update.php' needed after installation">''' Database changes'''</abbr>}}</td>
 
<td>{{#switch:{{{needs-updatephp|{{#invoke:Extension|getNeedsUpdates}}}}}|yes|Yes= Yes|no|No= No|{{{needs-updatephp|{{#invoke:Extension|getNeedsUpdates}}}}}}}</td>
 
<td>{{#switch:{{{needs-updatephp|{{#invoke:Extension|getNeedsUpdates}}}}}|yes|Yes= Yes|no|No= No|{{{needs-updatephp|{{#invoke:Extension|getNeedsUpdates}}}}}}}</td>
 
</tr>
 
</tr>
Line 362: Line 362:
 
<tr>
 
<tr>
 
<td colspan="2" style="text-align:center;">
 
<td colspan="2" style="text-align:center;">
  [[<tvar|1>translatewiki:Special:Translate/{{{translate|ext-{{lc:{{#invoke:String/enwiki|replace|{{BASEPAGENAME}}| |}}}}}}}</>|Translate the <tvar|2>{{BASEPAGENAME}}</> extension]] {{<tvar|3>#if:{{{translate|}}}|</>|if it is available at translatewiki.net}}</td>
+
  [[translatewiki:Special:Translate/{{{translate|ext-{{lc:{{#invoke:String/enwiki|replace|{{BASEPAGENAME}}| |}}}}}}}|Translate the {{BASEPAGENAME}} extension]] {{<tvar|3>#if:{{{translate|}}}||if it is available at translatewiki.net}}</td>
 
</tr><tr>
 
</tr><tr>
 
<td colspan="2" style="text-align:center;"><!--
 
<td colspan="2" style="text-align:center;"><!--
Line 378: Line 378:
 
     |<!-- no usage -->|
 
     |<!-- no usage -->|
 
<span style="white-space:nowrap">
 
<span style="white-space:nowrap">
[[<tvar|1>wikiapiary:Extension:{{{CheckUsageNameOverride|{{BASEPAGENAMEE}}}}}</>|Check usage and version matrix.]]
+
[[wikiapiary:Extension:{{{CheckUsageNameOverride|{{BASEPAGENAMEE}}}}}|Check usage and version matrix.]]
 
</span>
 
</span>
 
<!--
 
<!--
Line 434: Line 434:
  
  
It will add a useful infobox (see below) and will automatically add the extension to <tvar|1>{{ll|Category:All extensions}}</>, along with the appropriate {{<tvar|2>ll|Category:Extensions by status</>|status}} and {{<tvar|3>ll|Category:Extensions by implementation type</>|implementation type}} categories.
+
It will add a useful infobox (see below) and will automatically add the extension to {{ll|Category:All extensions}}, along with the appropriate {{ll|Category:Extensions by status|status}} and {{<tvar|3>ll|Category:Extensions by implementation type|implementation type}} categories.
  
 
== Usage ==  
 
== Usage ==  
Line 486: Line 486:
 
}}</pre>
 
}}</pre>
  
  For help with parameter values, see [[<tvar|1>#Content parameters</>|below]].</td>
+
  For help with parameter values, see [[#Content parameters|below]].</td>
 
<td align="right">{{Extension |templatemode=nocats
 
<td align="right">{{Extension |templatemode=nocats
 
|name            = {{{name}}}
 
|name            = {{{name}}}
Line 536: Line 536:
  
  
For help with <tvar|1>'''templatemode'''</> and other control parameters, please see ''[[<tvar|2>#Control parameters</>|Control parameters]]''.
+
For help with '''templatemode''' and other control parameters, please see ''[[#Control parameters|Control parameters]]''.
  
 
<!-- BEFORE YOU EDIT THIS:
 
<!-- BEFORE YOU EDIT THIS:
Line 559: Line 559:
  
  
* <tvar|unstable>''{{ll|Category:Unstable extensions|unstable}}''</> (broken - do not use this extension)
+
* <tvar|unstable>''{{ll|Category:Unstable extensions|unstable}}'' (broken - do not use this extension)
* <tvar|experimental>''{{ll|Category:Experimental extensions|experimental}}''</> (early stages of development, may change drastically)
+
* <tvar|experimental>''{{ll|Category:Experimental extensions|experimental}}'' (early stages of development, may change drastically)
* <tvar|beta>''{{ll|Category:Beta status extensions|beta}}''</> (stable but not fully tested)
+
* <tvar|beta>''{{ll|Category:Beta status extensions|beta}}'' (stable but not fully tested)
* <tvar|stable>''{{ll|Category:Stable extensions|stable}}''</> (stable version)
+
* <tvar|stable>''{{ll|Category:Stable extensions|stable}}'' (stable version)
* <tvar|unmaintained>''{{ll|Category:Not LTS ready|unmaintained}}''</> (unmaintained - previously claimed to be stable, now unmaintained)
+
* <tvar|unmaintained>''{{ll|Category:Not LTS ready|unmaintained}}'' (unmaintained - previously claimed to be stable, now unmaintained)
* <tvar|archive>''{{ll|Category:Archived extensions|archive}}''</> (archived - deprecated or merged with another extension)
+
* <tvar|archive>''{{ll|Category:Archived extensions|archive}}'' (archived - deprecated or merged with another extension)
* <tvar|unknown>''{{ll|Category:Extensions with unknown status|unknown}}''</> (default)
+
* <tvar|unknown>''{{ll|Category:Extensions with unknown status|unknown}}'' (default)
  
  
If the status is anything other than the above, it will be ignored and the default value of 'Unknown' will be displayed in the template instead.  In cases where the value is omitted, it will be categorized as {{ll|<tvar|url>:category:extensions with unknown status</>|unknown}}.  
+
If the status is anything other than the above, it will be ignored and the default value of 'Unknown' will be displayed in the template instead.  In cases where the value is omitted, it will be categorized as {{ll|<tvar|url>:category:extensions with unknown status|unknown}}.  
In cases where the value is invalid, it will be placed in a {{ll|<tvar|url>:category:extensions with invalid status</>|special category}} so that the error can be caught and fixed.
+
In cases where the value is invalid, it will be placed in a {{ll|<tvar|url>:category:extensions with invalid status|special category}} so that the error can be caught and fixed.
  
  
* {{ll|<tvar|url>Extension status</>|release status colour scheme}}</td>
+
* {{ll|<tvar|url>Extension status|release status colour scheme}}</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 579: Line 579:
  
 
The implementation strategy(s) employed in building this extension.  This parameter is used to create categories that help programmers find examples of various MediaWiki specific implementation strategies or patterns.  Although the values of this parameter sometimes coincide with the use case or purpose of an extension, that is not reason for this parameter.  
 
The implementation strategy(s) employed in building this extension.  This parameter is used to create categories that help programmers find examples of various MediaWiki specific implementation strategies or patterns.  Although the values of this parameter sometimes coincide with the use case or purpose of an extension, that is not reason for this parameter.  
If the values you have chosen for this parameter do not adequately identify the [[w:Requirements|purpose]] or possible [[w:Use case|use case]]s, we recommend you add additional {{ll|<tvar|url>Help:Categories</>|category links}} as needed.
+
If the values you have chosen for this parameter do not adequately identify the [[w:Requirements|purpose]] or possible [[w:Use case|use case]]s, we recommend you add additional {{ll|<tvar|url>Help:Categories|category links}} as needed.
  
  
 
Allowed values for the '''type1''', '''type2''', ... parameters are:
 
Allowed values for the '''type1''', '''type2''', ... parameters are:
* <tvar|parser>'''''{{ll|Category:Parser extensions|parser}}'''''</> - catchall for uncategorized {{ll|<tvar|url1>Manual:Extending wiki markup</>|parser extensions}}. If you have written a parser extension, please use one of the following more specific types:
+
* <tvar|parser>'''''{{ll|Category:Parser extensions|parser}}''''' - catchall for uncategorized {{ll|<tvar|url1>Manual:Extending wiki markup|parser extensions}}. If you have written a parser extension, please use one of the following more specific types:
** <tvar|conthandl>''{{ll|Category:ContentHandler extensions|contenthandler}}''</> - Extensions using <tvar|contenthandler>{{ll|Manual:ContentHandler|ContentHandler}}</>.
+
** <tvar|conthandl>''{{ll|Category:ContentHandler extensions|contenthandler}}'' - Extensions using <tvar|contenthandler>{{ll|Manual:ContentHandler|ContentHandler}}.
** <tvar|link>''{{ll|Category:Link markup extensions|link}}''</> - customized {{ll|<tvar|url2>Manual:Extending wiki markup</>|link markup}}, e.g. <tvar|xmp1><code><nowiki>[[</nowiki>...]]</code></>
+
** <tvar|link>''{{ll|Category:Link markup extensions|link}}'' - customized {{ll|<tvar|url2>Manual:Extending wiki markup|link markup}}, e.g. <tvar|xmp1><code><nowiki>[[</nowiki>...]]</code>
** <tvar|parserfunction>''{{ll|Category:Parser function extensions|parser function}}''</> - custom {{ll|<tvar|url3>Manual:Parser functions</>|parameterized template markup}}, e.g. <tvar|xmp2><code><nowiki>{{</nowiki>''#name:'' ... <nowiki>}}</nowiki></code></>
+
** <tvar|parserfunction>''{{ll|Category:Parser function extensions|parser function}}'' - custom {{ll|<tvar|url3>Manual:Parser functions|parameterized template markup}}, e.g. <tvar|xmp2><code><nowiki>{{</nowiki>''#name:'' ... <nowiki>}}</nowiki></code>
** <tvar|tag>''{{ll|Category:Tag extensions|tag}}''</> - {{ll|<tvar|url4>Manual:Tag extensions</>|custom XML tag markup}}, e.g. <tvar|xmp4><code><nowiki><</nowiki>''tagname''>...<nowiki></</nowiki>''tagname''></code></>
+
** <tvar|tag>''{{ll|Category:Tag extensions|tag}}'' - {{ll|<tvar|url4>Manual:Tag extensions|custom XML tag markup}}, e.g. <tvar|xmp4><code><nowiki><</nowiki>''tagname''>...<nowiki></</nowiki>''tagname''></code>
** <tvar|variable>''{{ll|Category:Variable extensions|variable}}''</> - custom {{ll|<tvar|url5>Manual:Variables</>|unparameterized template markup}}, e.g. <tvar|xmp5><code><nowiki>{{NAME}}</nowiki></code></>
+
** <tvar|variable>''{{ll|Category:Variable extensions|variable}}'' - custom {{ll|<tvar|url5>Manual:Variables|unparameterized template markup}}, e.g. <tvar|xmp5><code><nowiki>{{NAME}}</nowiki></code>
** <tvar|xtdsyntax>''{{ll|Category:Extended syntax extensions|extended syntax}}''</> - Extensions that add non-standard wiki syntax (i.e. <em>not</em> {{ll|<tvar|url61>Manual:Tag extensions</>|tags}}, {{ll|<tvar|url62>Manual:Parser functions</>|parser functions}}, or {{ll|<tvar|url63>Manual:Variables</>|variables}}).
+
** <tvar|xtdsyntax>''{{ll|Category:Extended syntax extensions|extended syntax}}'' - Extensions that add non-standard wiki syntax (i.e. <em>not</em> {{ll|<tvar|url61>Manual:Tag extensions|tags}}, {{ll|<tvar|url62>Manual:Parser functions|parser functions}}, or {{ll|<tvar|url63>Manual:Variables|variables}}).
 
*:
 
*:
  
  
* <tvar|access>{{ll|Category:User access extensions|'''''access'''''}}</> - catchall for {{ll|<tvar|url1>Manual:User access extensions</>|user access extensions}}, that is, extensions that create, authenticate, grant permissions, revoke permissions, or monitor the activity of users. If you have written an access extension, please use one of the following more specific types:
+
* <tvar|access>{{ll|Category:User access extensions|'''''access'''''}} - catchall for {{ll|<tvar|url1>Manual:User access extensions|user access extensions}}, that is, extensions that create, authenticate, grant permissions, revoke permissions, or monitor the activity of users. If you have written an access extension, please use one of the following more specific types:
** <tvar|useractivity>{{ll|Category:User activity extensions|''user activity''}}</> - extensions that monitor user activity (logins, logouts, new user creation, etc.)
+
** <tvar|useractivity>{{ll|Category:User activity extensions|''user activity''}} - extensions that monitor user activity (logins, logouts, new user creation, etc.)
** <tvar|useridentity>{{ll|Category:User identity extensions|''user identity''}}</> - extensions that create and delete users, and/or verify the identity of a user
+
** <tvar|useridentity>{{ll|Category:User identity extensions|''user identity''}} - extensions that create and delete users, and/or verify the identity of a user
** <tvar|userrights>{{ll|Category:User rights extensions|''user rights''}}</> - extensions to the rights management system, e.g. changes to the way rights are assigned, API, maintenance tools (does not include extensions that merely name the rights needed to use the features of that extension; for this purpose use the [[<tvar|skip>#rights</>|rights parameter]])
+
** <tvar|userrights>{{ll|Category:User rights extensions|''user rights''}} - extensions to the rights management system, e.g. changes to the way rights are assigned, API, maintenance tools (does not include extensions that merely name the rights needed to use the features of that extension; for this purpose use the [[<tvar|skip>#rights|rights parameter]])
  
  
* <tvar|interface>{{ll|Category:User interface extensions|'''''interface'''''}}</> - catchall for uncategorized user interface extensions.
+
* <tvar|interface>{{ll|Category:User interface extensions|'''''interface'''''}} - catchall for uncategorized user interface extensions.
** <tvar|media>''{{ll|Category:Media handling extensions|media}}''</> - extensions that permit the embedding of multimedia content on wiki pages by registering a file extension with <tvar|wgMediaHandlers>{{ll|Manual:$wgMediaHandlers|$wgMediaHandlers}}</>.
+
** <tvar|media>''{{ll|Category:Media handling extensions|media}}'' - extensions that permit the embedding of multimedia content on wiki pages by registering a file extension with <tvar|wgMediaHandlers>{{ll|Manual:$wgMediaHandlers|$wgMediaHandlers}}.
** <tvar|mywiki>''{{ll|Category:Personalization extensions|mywiki}}''</> - extensions that provide infrastructure so that users may personalize their MediaWiki experience and/or assist in the management of that infrastructure
+
** <tvar|mywiki>''{{ll|Category:Personalization extensions|mywiki}}'' - extensions that provide infrastructure so that users may personalize their MediaWiki experience and/or assist in the management of that infrastructure
** <tvar|notify>{{ll|Category:Notification extensions|''notify''}}</> - extensions that email users, broadcast messages and provide other forms of community notification
+
** <tvar|notify>{{ll|Category:Notification extensions|''notify''}} - extensions that email users, broadcast messages and provide other forms of community notification
** <tvar|catpageaction>''{{ll|Category:Page action extensions|''page action''}}''</> - extensions that enhance or modify <tvar|pageaction>{{ll|Manual:Page action|page action}}</>s. This includes anything that implements an action that reads, writes, searches for, creates, renames, deletes, redirects or discusses a page. It does not include rights (use <tvar|userrights>''user rights''</>) or logs (use <tvar|useractivity>''user activity''</>).
+
** <tvar|catpageaction>''{{ll|Category:Page action extensions|''page action''}}'' - extensions that enhance or modify <tvar|pageaction>{{ll|Manual:Page action|page action}}s. This includes anything that implements an action that reads, writes, searches for, creates, renames, deletes, redirects or discusses a page. It does not include rights (use <tvar|userrights>''user rights'') or logs (use <tvar|useractivity>''user activity'').
** <tvar|search>{{ll|Category:Search extensions|''search''}}</> - extensions that search through and select articles for users.
+
** <tvar|search>{{ll|Category:Search extensions|''search''}} - extensions that search through and select articles for users.
** <tvar|skin>{{ll|Category:Skin extensions|''skin''}}</> - extensions adding [[w:CSS|CSS]] or [[w:JavaScript|JavaScript]], or implementing hook functions to change the look and feel of MediaWiki via the skins framework.
+
** <tvar|skin>{{ll|Category:Skin extensions|''skin''}} - extensions adding [[w:CSS|CSS]] or [[w:JavaScript|JavaScript]], or implementing hook functions to change the look and feel of MediaWiki via the skins framework.
** <tvar|catajax>{{ll|Category:Ajax extensions|''ajax''}}</> - extensions that use [[w:AJAX|Ajax]] programming techniques.
+
** <tvar|catajax>{{ll|Category:Ajax extensions|''ajax''}} - extensions that use [[w:AJAX|Ajax]] programming techniques.
** <tvar|special>{{ll|Category:Special page extensions|''special''}}</> - extensions that subclass the <tvar|specialpage>{{Class doclink|SpecialPage}}</> class, use one of its hooks, or patch one or more functions in <tvar|filephp>{{Git file|file=includes/specialpage/SpecialPage.php|text=SpecialPage.php}}</>. See <tvar|manual>{{ll|Manual:Special pages|Special pages}}</> for more information.
+
** <tvar|special>{{ll|Category:Special page extensions|''special''}} - extensions that subclass the <tvar|specialpage>{{Class doclink|SpecialPage}} class, use one of its hooks, or patch one or more functions in <tvar|filephp>{{Git file|file=includes/specialpage/SpecialPage.php|text=SpecialPage.php}}. See <tvar|manual>{{ll|Manual:Special pages|Special pages}} for more information.
  
  
 
* '''other'''
 
* '''other'''
** <tvar|api>{{ll|Category:API extensions|''api''}}</> - extensions that add a new API module or extend a core API module.
+
** <tvar|api>{{ll|Category:API extensions|''api''}} - extensions that add a new API module or extend a core API module.
** <tvar|hook>{{ll|Category:Hook extensions|''hook''}}</> - Hook extension - defines a <em>new</em> hook - see hook1, etc. below if you want to define hooks <em>used</em> by your extension
+
** <tvar|hook>{{ll|Category:Hook extensions|''hook''}} - Hook extension - defines a <em>new</em> hook - see hook1, etc. below if you want to define hooks <em>used</em> by your extension
** <tvar|database>{{ll|Category:Database extensions|''database''}}</> - adds tables and/or fields to the database backing a MediaWiki installation
+
** <tvar|database>{{ll|Category:Database extensions|''database''}} - adds tables and/or fields to the database backing a MediaWiki installation
** <tvar|dataextraction>{{ll|Category:Data extraction extensions|''data extraction''}}</> - Data extraction
+
** <tvar|dataextraction>{{ll|Category:Data extraction extensions|''data extraction''}} - Data extraction
** <tvar|filerepo>{{ll|Category:File repository extensions|''filerepo''}}</> - extension that adds new file repository types as file backend
+
** <tvar|filerepo>{{ll|Category:File repository extensions|''filerepo''}} - extension that adds new file repository types as file backend
** <tvar|example>{{ll|Category:Extension examples|''example''}}</> - Not a real extension, but an example of how to write one
+
** <tvar|example>{{ll|Category:Extension examples|''example''}} - Not a real extension, but an example of how to write one
  
  
Any other value for 'type' is invalid, and will cause the extension to be placed in <tvar|typemissingcat>[[:Category:Extensions with invalid or missing type{{#translation:}}]]</>.
+
Any other value for 'type' is invalid, and will cause the extension to be placed in <tvar|typemissingcat>[[:Category:Extensions with invalid or missing type{{#translation:}}]].
  
  
Note: Many extensions have more than one type, if this applies to yours, replace <tvar|type><code><nowiki>|type=</nowiki></code></> with <tvar|value><code><nowiki>|type1=|type2=|type3=...</nowiki></code></>. You may define up to six types for an extension.</td>
+
Note: Many extensions have more than one type, if this applies to yours, replace <tvar|type><code><nowiki>|type=</nowiki></code> with <tvar|value><code><nowiki>|type1=|type2=|type3=...</nowiki></code>. You may define up to six types for an extension.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 634: Line 634:
  
 
For built-in hooks:
 
For built-in hooks:
* use the hook name alone. Please see <tvar|manual>{{ll|Manual:Hooks|Manual:Hooks}}</> for values (but omit introductory '/').
+
* use the hook name alone. Please see <tvar|manual>{{ll|Manual:Hooks|Manual:Hooks}} for values (but omit introductory '/').
  
  
 
For custom hooks defined by extensions:
 
For custom hooks defined by extensions:
* use <tvar|form>''extensionName''/''hookName''</>. For a partial list of custom hooks, see <tvar|exthooks>[[Extension hook registry]]</>.
+
* use <tvar|form>''extensionName''/''hookName''. For a partial list of custom hooks, see <tvar|exthooks>[[Extension hook registry]].
  
  
Line 649: Line 649:
  
  
You might also want to add the hooks to <tvar|exthooks>[[Extension hook registry]]</>.</td>
+
You might also want to add the hooks to <tvar|exthooks>[[Extension hook registry]].</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="username">'''username'''</span></td><td> The author's username on MediaWiki.org (if they have one).  May be omitted, but if present it will be used to link to the author's user & user_talk page.  It should be provided without namespace and without <tvar|1><nowiki>[[]]</nowiki></>s.</td>
+
<td><span id="username">'''username'''</span></td><td> The author's username on MediaWiki.org (if they have one).  May be omitted, but if present it will be used to link to the author's user & user_talk page.  It should be provided without namespace and without <nowiki>[[]]</nowiki>s.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 661: Line 661:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="image">image</span></td><td> screenshot or logo of extension.  It should be provided without namespace and without <tvar|1><nowiki>[[]]</nowiki></>s.</td>
+
<td><span id="image">image</span></td><td> screenshot or logo of extension.  It should be provided without namespace and without <nowiki>[[]]</nowiki>s.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 673: Line 673:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="compatibility_policy">compatibility policy</span></td><td> {{<tvar|1>ll|Compatibility#mediawiki_extensions</>|compatibility policy}} (accepted values are <tvar|2>'''master'''</> and <tvar|3>'''rel'''</>). ({{ll|Category:Extensions without a compatibility policy| backlog}})</td>
+
<td><span id="compatibility_policy">compatibility policy</span></td><td> {{ll|Compatibility#mediawiki_extensions|compatibility policy}} (accepted values are '''master''' and <tvar|3>'''rel'''). ({{ll|Category:Extensions without a compatibility policy| backlog}})</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 683: Line 683:
 
<tr>
 
<tr>
 
<td><span id="needs-updatephp">needs-updatephp</span></td><td>
 
<td><span id="needs-updatephp">needs-updatephp</span></td><td>
<tvar|yes><code>yes</code></> indicates that the extension requires a database table schema change or a similar action, before the MediaWiki can run. It is a common pitfall: your MediaWiki will stall, if you forgot to run update.php - if the extension requires it. <tvar|no><code>no</code></> should be set as a value since this assures that the extension does not need update.php to be run and thus avoids uncertainty
+
<tvar|yes><code>yes</code> indicates that the extension requires a database table schema change or a similar action, before the MediaWiki can run. It is a common pitfall: your MediaWiki will stall, if you forgot to run update.php - if the extension requires it. <tvar|no><code>no</code> should be set as a value since this assures that the extension does not need update.php to be run and thus avoids uncertainty
  
  
Extensions which conform to MediaWiki extension standards come with a '''schema change script which you need to start manually''' (once) before starting and accessing the MediaWiki through your browser, and after you copied all the extension files to <tvar|target><code>$IP/extensions/ExtensionName</code></> and inserted <tvar|code><code>wfLoadExtension( "ExtensionName");</code></> into "LocalSettings.php", run from the command line:
+
Extensions which conform to MediaWiki extension standards come with a '''schema change script which you need to start manually''' (once) before starting and accessing the MediaWiki through your browser, and after you copied all the extension files to <tvar|target><code>$IP/extensions/ExtensionName</code> and inserted <tvar|code><code>wfLoadExtension( "ExtensionName");</code> into "LocalSettings.php", run from the command line:
  
 
  cd path/to/wiki_install_directory
 
  cd path/to/wiki_install_directory
Line 695: Line 695:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="php">composer</span></td><td> If applicable the name of the "vendor" as well as the "package" should be entered in the format <tvar|format><code>vendor/package</code></>, e.g. <tvar|xmp><code>mediawiki/semantic-media-wiki</code></> to point people directly to packagist.org, which serves as the package archive.</td>
+
<td><span id="php">composer</span></td><td> If applicable the name of the "vendor" as well as the "package" should be entered in the format <tvar|format><code>vendor/package</code>, e.g. <tvar|xmp><code>mediawiki/semantic-media-wiki</code> to point people directly to packagist.org, which serves as the package archive.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 702: Line 702:
  
  
Links to a subpage of your extension page. For instance, "<tvar|table1>table1 = cu_changes</>" at <tvar|url1>{{ll|Extension:CheckUser|Extension:CheckUser}}</> will link to <tvar|url2>{{ll|Extension:CheckUser/cu_changes table|Extension:CheckUser/cu_changes table}}</>. Don't list core tables such as <tvar|page>{{ll|Manual:Page table|page}}</> or <tvar|revision>{{ll|Manual:Revision table|revision}}</>; only list tables that are added by extensions.</td>
+
Links to a subpage of your extension page. For instance, "<tvar|table1>table1 = cu_changes" at <tvar|url1>{{ll|Extension:CheckUser|Extension:CheckUser}} will link to <tvar|url2>{{ll|Extension:CheckUser/cu_changes table|Extension:CheckUser/cu_changes table}}. Don't list core tables such as <tvar|page>{{ll|Manual:Page table|page}} or <tvar|revision>{{ll|Manual:Revision table|revision}}; only list tables that are added by extensions.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="license">license</span></td><td> license governing use of this extension, as one of the codes found in <tvar|url>https://spdx.org/licenses/</>, e.g. <tvar|later2><code>GPL-2.0-or-later</code></>, <tvar|only2><code>GPL-2.0-only</code></> or <tvar|later3><code>GPL-3.0-or-later</code></>, etc.</td>
+
<td><span id="license">license</span></td><td> license governing use of this extension, as one of the codes found in <tvar|url>https://spdx.org/licenses/, e.g. <tvar|later2><code>GPL-2.0-or-later</code>, <tvar|only2><code>GPL-2.0-only</code> or <tvar|later3><code>GPL-3.0-or-later</code>, etc.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="download">'''download'''</span></td><td> '''link to the download''' : <tvar|url>[https://phabricator.wikimedia.org/r/project/mediawiki/core Git]</>, <tvar|wikimediadownload>{{tl|WikimediaDownload{{#translation:}}}}</> with <tvar|server>server=svn</> in case it was not migrated from <tvar|svn>{{ll|Subversion|Subversion}}</>. If you put the code into page in the MediaWiki wiki, link to it using a full page name and section name, e.g. <tvar|code><code> <nowiki>[[Extension:Example/version_1.22a#Code]]</nowiki> </code></> (it must remain valid when bot-copied elsewhere)</td>
+
<td><span id="download">'''download'''</span></td><td> '''link to the download''' : <tvar|url>[https://phabricator.wikimedia.org/r/project/mediawiki/core Git], <tvar|wikimediadownload>{{tl|WikimediaDownload{{#translation:}}}} with <tvar|server>server=svn in case it was not migrated from <tvar|svn>{{ll|Subversion|Subversion}}. If you put the code into page in the MediaWiki wiki, link to it using a full page name and section name, e.g. <tvar|code><code> <nowiki>[[Extension:Example/version_1.22a#Code]]</nowiki> </code> (it must remain valid when bot-copied elsewhere)</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="readme">readme</span></td><td> external link to the <tvar|readme>readme</> file, e.g. <tvar|url>https://phabricator.wikimedia.org/r/browse/mediawiki/extensions/Flow;master;README</></td>
+
<td><span id="readme">readme</span></td><td> external link to the <tvar|readme>readme file, e.g. <tvar|url>https://phabricator.wikimedia.org/r/browse/mediawiki/extensions/Flow;master;README</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="changelog">changelog</span></td><td> external link to the changelog file, e.g. <tvar|url>[[Extension:LDAP Authentication/Changelog]]</></td>
+
<td><span id="changelog">changelog</span></td><td> external link to the changelog file, e.g. <tvar|url>[[Extension:LDAP Authentication/Changelog]]</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 720: Line 720:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="tags">tags</span></td><td> any tags your extension uses (e.g. <tvar|tags>&lt;tag1&gt;, &lt;tag2&gt;</>).</td>
+
<td><span id="tags">tags</span></td><td> any tags your extension uses (e.g. <tvar|tags>&lt;tag1&gt;, &lt;tag2&gt;).</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td>rights</td><td><span id="rights"></span>  rights added by the extension. '''Not to be confused with the license!''' Rights are such as <tvar|makebot>''{{ll|Extension:MakeBot|makebot}}''</> or <tvar|desysop>''{{ll|Extension:Desysop|desysop}}''</>, not such as GFDL or LGPL or GPL - those are licenses!</td>
+
<td>rights</td><td><span id="rights"></span>  rights added by the extension. '''Not to be confused with the license!''' Rights are such as <tvar|makebot>''{{ll|Extension:MakeBot|makebot}}'' or <tvar|desysop>''{{ll|Extension:Desysop|desysop}}'', not such as GFDL or LGPL or GPL - those are licenses!</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 732: Line 732:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><span id="compatibility">compatibility</span></td><td> Additional compatibility information, for instance compatibility charts (formerly using <tvar|testext>[[Template:Extension Testing]]</>). It's encouraged to add any client-side compatibility information here too, especially when diverging from {{ll|<tvar|url>Compatibility#Browsers</>|expectations of full support for a browser}}.</td>
+
<td><span id="compatibility">compatibility</span></td><td> Additional compatibility information, for instance compatibility charts (formerly using <tvar|testext>[[Template:Extension Testing]]). It's encouraged to add any client-side compatibility information here too, especially when diverging from {{ll|<tvar|url>Compatibility#Browsers|expectations of full support for a browser}}.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td><span id="translate">translate</span></td><td>
 
<td><span id="translate">translate</span></td><td>
Optional parameter to link the exact page where ({{ll|<tvar|url>Help:Extension:Translate/Glossary</>|message group id}} with which) the extension will be translatable on <tvar|translatewiki>[[translatewiki.net]]</> if enabled. If the default link is incorrect, manually set it to:
+
Optional parameter to link the exact page where ({{ll|<tvar|url>Help:Extension:Translate/Glossary|message group id}} with which) the extension will be translatable on <tvar|translatewiki>[[translatewiki.net]] if enabled. If the default link is incorrect, manually set it to:
* <tvar|lowercase>ext-LOWERCASE</>(<tvar|nospaces>NOSPACES</>(Label as defined in <tvar|file>{{git file|project=translatewiki|branch=HEAD|file=groups/MediaWiki/ExtensionsAgg.yaml|text=config}}</>)), aka
+
* <tvar|lowercase>ext-LOWERCASE(<tvar|nospaces>NOSPACES(Label as defined in <tvar|file>{{git file|project=translatewiki|branch=HEAD|file=groups/MediaWiki/ExtensionsAgg.yaml|text=config}})), aka
 
* the parameter you get in the URL after
 
* the parameter you get in the URL after
** typing the name of the extension in the search/filter box at <tvar|tranlwikispectransl>[[translatewiki:Special:Translate]]</> or  
+
** typing the name of the extension in the search/filter box at <tvar|tranlwikispectransl>[[translatewiki:Special:Translate]] or  
** searching for its name in <tvar|transwikilangstat>[https://translatewiki.net/w/i.php?title=Special%3ALanguageStats&x=D languagestats]</> after clicking "expand all".</td>
+
** searching for its name in <tvar|transwikilangstat>[https://translatewiki.net/w/i.php?title=Special%3ALanguageStats&x=D languagestats] after clicking "expand all".</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 769: Line 769:
  
 
Normally left blank. Alternate values are:
 
Normally left blank. Alternate values are:
* <tvar|nocats>''nocats''</> - suppresses categorization and the 'check usage' link. Use this value if you are adding this template to {{ll|<tvar|url>Help:Subpage</>|subpages}} of an extension or to how-to documentation of extensions. For example, the usage image above sets <tvar|nocats><code>templatemode=nocats</code></> because this isn't an actual extension page and we don't want to add this page to any categories on account of it.
+
* <tvar|nocats>''nocats'' - suppresses categorization and the 'check usage' link. Use this value if you are adding this template to {{ll|<tvar|url>Help:Subpage|subpages}} of an extension or to how-to documentation of extensions. For example, the usage image above sets <tvar|nocats><code>templatemode=nocats</code> because this isn't an actual extension page and we don't want to add this page to any categories on account of it.
* <tvar|nousage>''nousage''</> - suppresses the 'check usage' link. Link is also suppressed if the page is a subpage; it is not in the Extension: namespace; or if suppressed by '<tvar|templatemode>templatemode=nocats</>'
+
* <tvar|nousage>''nousage'' - suppresses the 'check usage' link. Link is also suppressed if the page is a subpage; it is not in the Extension: namespace; or if suppressed by '<tvar|templatemode>templatemode=nocats'
  
  
If this is left blank, this template will add the host page to <tvar|allextcat>[[:Category:All extensions{{#translation:}}]]</> and to one or more additional categories, depending on the values assigned to the [[<tvar|anchor>#Content parameters</>|Content parameters]].</td>
+
If this is left blank, this template will add the host page to <tvar|allextcat>[[:Category:All extensions{{#translation:}}]] and to one or more additional categories, depending on the values assigned to the [[<tvar|anchor>#Content parameters|Content parameters]].</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
Line 783: Line 783:
  
  
If you want to add the infobox to an existing page, copy and paste the code at the [[<tvar|1>#CutAndPaste</>|top of this page]].
+
If you want to add the infobox to an existing page, copy and paste the code at the [[#CutAndPaste|top of this page]].
  
 
=== Create a new extension article ===  
 
=== Create a new extension article ===  
Line 811: Line 811:
  
  
* '''<tvar|extsample>{{ll|Template:Extension/Sample}}</>:''' The boilerplate extension that is preloaded into newly-created pages.
+
* '''<tvar|extsample>{{ll|Template:Extension/Sample}}:''' The boilerplate extension that is preloaded into newly-created pages.
* '''<tvar|extinpbox>{{ll|Template:Extension/CreateExtensionInputBox}}</>:''' An input box that can be inserted wherever you want users to easily create extensions. For documentation on the <tvar|tagvalue><code><nowiki><inputbox></nowiki></code></> tag, please see <tvar|url>{{ll|Extension:InputBox|Extension:InputBox}}</>.
+
* '''<tvar|extinpbox>{{ll|Template:Extension/CreateExtensionInputBox}}:''' An input box that can be inserted wherever you want users to easily create extensions. For documentation on the <tvar|tagvalue><code><nowiki><inputbox></nowiki></code> tag, please see <tvar|url>{{ll|Extension:InputBox|Extension:InputBox}}.
  
 
=== Infobox parameters ===  
 
=== Infobox parameters ===  
Line 820: Line 820:
  
  
* To make this template easy to use, each label in the infobox is linked to documentation on the template parameter(s) it displays. If you add a parameter, please be sure to also add it to the {{ll|<tvar|anchor>Template:Extension#Content parameters</>|content parameter documentation}} and link its label to that documentation.
+
* To make this template easy to use, each label in the infobox is linked to documentation on the template parameter(s) it displays. If you add a parameter, please be sure to also add it to the {{ll|<tvar|anchor>Template:Extension#Content parameters|content parameter documentation}} and link its label to that documentation.
  
  
 
To change/correct/add to the implementation type parameters:
 
To change/correct/add to the implementation type parameters:
* Check the [[<tvar|url>Template_talk:Extension</>|talk page]] - there have been some extensive discussions about this field.
+
* Check the [[<tvar|url>Template_talk:Extension|talk page]] - there have been some extensive discussions about this field.
* '''<tvar|typeswitch>{{ll|Template:Extension/TypeSwitch|Template:Extension/TypeSwitch}}</>:''' Stores the possible values for the type field. Multiple values are implemented by calling this template with <tvar|foreach>[[Template:Foreach]]</>.
+
* '''<tvar|typeswitch>{{ll|Template:Extension/TypeSwitch|Template:Extension/TypeSwitch}}:''' Stores the possible values for the type field. Multiple values are implemented by calling this template with <tvar|foreach>[[Template:Foreach]].
* '''<tvar|typeswitchnocats>{{ll|Template:Extension/TypeSwitchNoCats|Template:Extension/TypeSwitchNoCats}}</>:''' Does not need to be modified when adding a new type. Used instead of <tvar|typeswitch>{{ll|Template:Extension/TypeSwitch|Template:Extension/TypeSwitch}}</> when this template is used in <tvar|nocats><code>templatemode=nocats</code></>. Templates used with <tvar|foreach>[[Template:Foreach]]</> can only take one parameter so we need to wrap the call to <tvar|tpeswitch>{{ll|Template:Extension/TypeSwitch|Template:Extension/TypeSwitch}}</> with another template that sets the mode.
+
* '''<tvar|typeswitchnocats>{{ll|Template:Extension/TypeSwitchNoCats|Template:Extension/TypeSwitchNoCats}}:''' Does not need to be modified when adding a new type. Used instead of <tvar|typeswitch>{{ll|Template:Extension/TypeSwitch|Template:Extension/TypeSwitch}} when this template is used in <tvar|nocats><code>templatemode=nocats</code>. Templates used with <tvar|foreach>[[Template:Foreach]] can only take one parameter so we need to wrap the call to <tvar|tpeswitch>{{ll|Template:Extension/TypeSwitch|Template:Extension/TypeSwitch}} with another template that sets the mode.
  
  
Line 832: Line 832:
  
  
* '''<tvar|hookinuse>[[Template:Extension/HookInUse]]</>:''' Adds links and categories for a hook in use. Multiple hooks in use are implemented by calling this template with <tvar|foreach>[[Template:Foreach]]</>.
+
* '''<tvar|hookinuse>[[Template:Extension/HookInUse]]:''' Adds links and categories for a hook in use. Multiple hooks in use are implemented by calling this template with <tvar|foreach>[[Template:Foreach]].
* '''<tvar|hookinusenocats>[[Template:Extension/HookInUseNoCats]]</>:''' Used instead of <tvar|hookinuse>[[Template:Extension/HookInUse]]</> when this template is used in <tvar|nocats><code>templatemode=nocats</code></>. Templates used with <tvar|feach>[[Template:Foreach]]</> can only take one parameter so we need to wrap the call to <tvar|hookuse>[[Template:Extension/HookInUse]]</> with another template that sets the mode.
+
* '''<tvar|hookinusenocats>[[Template:Extension/HookInUseNoCats]]:''' Used instead of <tvar|hookinuse>[[Template:Extension/HookInUse]] when this template is used in <tvar|nocats><code>templatemode=nocats</code>. Templates used with <tvar|feach>[[Template:Foreach]] can only take one parameter so we need to wrap the call to <tvar|hookuse>[[Template:Extension/HookInUse]] with another template that sets the mode.
  
 
== Test case ==  
 
== Test case ==  

Latest revision as of 18:13, 21 December 2019


Template documentation


This template should be added to all extension pages on this wiki (but only the main page).


It will add a useful infobox (see below) and will automatically add the extension to Category:All extensions , along with the appropriate status and {{<tvar|3>ll|Category:Extensions by implementation type|implementation type}} categories.

Usage

Copy and paste:

{{Extension |templatemode =
|name                 = 
|status               = 
|type1                = 
|type2                = 
|hook1                = 
|hook2                = 
|newhook1             = 
|newhook2             = 
|username             = 
|author               = 
|description          = 
|image                = 
|imagesize            = 
|version              = 
|update               = 
|version preview      = 
|update preview       = 
|compatibility policy =
|mediawiki            = 
|php                  = 
|needs-updatephp      = 
|composer             =
|table1               = 
|table2               = 
|license              = 
|download             = 
|readme               = 
|changelog            = 
|example              = 
|namespace            = 
|parameters           = 
|tags                 = 
|rights               = 
|compatibility        = 
|bugzilla             = 
|phabricator          =
|vagrant-role         = 
}}
For help with parameter values, see below.
MediaWiki extensions manual
OOjs UI icon advanced.svg
{{{name}}}
Release status: unknown
Placeholder.png
Implementation {{{type1}}}, {{{type2}}}
Description {{{description}}}
Author(s) SomeAuthor (SomeUsertalk)
Latest version {{{version}}} ({{{update}}})
Latest preview version {{{version preview}}} ({{{update preview}}})
Compatibility policy invalid
MediaWiki {{{mediawiki}}}
PHP {{{php}}}
com>'php update.php' needed after installation"> Database changes {{{needs-updatephp}}}
Composer {{{composer}}}
Tables [[Special:MyLanguage/Template:Extension/{{{table1}}} table|{{{table1}}}]][[:Template:Extension/{{{table1}}} table| ]]
[[Special:MyLanguage/Template:Extension/{{{table2}}} table|{{{table2}}}]][[:Template:Extension/{{{table2}}} table| ]]
License {{{license}}}
Download {{{download}}}
{{{readme}}}
{{{changelog}}}
Example {{{example}}}
{{{namespace}}}
{{{parameters}}}
{{{tags}}}

{{{rights}}}

{{{compatibility}}}
Translate the Extension extension {{<tvar|3>#if:||if it is available at translatewiki.net}}
Vagrant role {{{vagrant-role}}}
Issues [[phab:tag/{{{phabricator}}}| Open tasks]] · Report a bug

Content parameters

This section describes parameters that govern infobox content.


For help with templatemode and other control parameters, please see Control parameters.

Content parameters
Parameter Description
name name of the extension
status current release status


One of:


  • <tvar

Maintenance: vulnerabilities, archived