Extension:MyVariables
This extension is professionally maintained by the WikiTeq team.
WikiTeq provides official support for MediaWiki LTS releases only. It may work with other MediaWiki releases.
![]() Release status: stable |
|
---|---|
Implementation | Variable |
Description | Adds new built-in variables |
Author(s) | |
Maintainer(s) | WikiTeq team |
Latest version | 4.3 (2021-09-23) |
Compatibility policy | For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension. |
MediaWiki | 1.31-1.35, 1.39 |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | |
Quarterly downloads | 52 (Ranked 126th) |
Translate the MyVariables extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
The MyVariables extension adds new built-in variables:
Variable | Description | Sample |
---|---|---|
{{CURRENTUSER}}
|
Login of current user or the IP for anonymous users. | "Pastakhov" or "x.x.x.x" |
{{CURRENTLOGGEDUSER}}
|
Login of current user or empty for anonymous users. | "Pastakhov" or "" |
{{CURRENTUSERREALNAME}}
|
Real name of current user. | "Pavel Astakhov" |
{{HITCOUNTER}}
|
Number of visits (hits) to the current page according to Extension:HitCounters or empty if the extension isn't installed. | "123" or "" |
{{LOGO}}
|
Path to wiki logo. | "/w/skins/common/images/wiki.png" |
{{UUID}}
|
Random (v4) UUID. | "65ba1a51-c723-4b9d-b1f3-13148d628322" |
{{USERLANGUAGECODE}}
|
Language that the user specified in the preferences. | "en", "en-ca", "ru", etc. |
{{USERREGISTRATION}}
|
Timestamp of the date at which the user registered or empty if the page isn't a user page. | "20100809003006" or "" |
{{FIRSTREVISIONID}}
|
ID of the first revision of the current page or empty if page isn't yet created. | "1" or "" |
{{FIRSTREVISIONTIMESTAMP}}
|
Timestamp of the first revision of the current page or empty if page isn't yet created. | "20100809003006" or "" |
{{FIRSTREVISIONUSER}}
|
The user name (without the User prefix) or IP address associated to the first revision of the current page or empty if page isn't yet created. | "Pastakhov", "x.x.x.x" or "" |
{{PAGEIMAGE}}
|
The main image of the current page as determined by Extension:PageImages . If the extension is not installed or no main image was determined then {{PAGEIMAGE}} will output nothing. | "Logo.png" or "" |
{{REALNAME}}
|
When used in a user page, will output the real name of the user. However, if used like this {{REALNAME:Jimbo}} it will output the real name of the user Jimbo. This dual behavior is similar to core variables like {{PAGENAME}}. | "Pastakhov" or "" |
{{REDIRECTS}}
|
Comma-separated list of redirects to the current page or empty if there're no redirects. | "Foo, Bar, Baz" or "" |
{{SUBPAGES}}
|
The subpages of the current page, in plain text, comma-separated and in alphabetic order. If there are no any subpages, it will output nothing. | "Pastakhov/Subpage1, Pastakhov/Subpage2" or "" |
{{WHATLINKSHERE}}
|
The titles of the pages that link to the current page, comma-separated and in alphabetic order. It will be empty if there are no linked pages. | "Bar, Baz, Foo" or "" |
Installation[edit]
- Download and place the file(s) in a directory called
MyVariables
in yourextensions/
folder. - Add the following code at the bottom of your
LocalSettings.php
:wfLoadExtension( 'MyVariables' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Note[edit]
- This extension should not be confused with the Variables extension, which allows the use of variables in the computer programming sense.
See also[edit]
- Extension:Semantic Extra Special Properties - Semantic properties for page authors, subpages and more
- Extension:IDProvider
- Extension:UserFunctions
- Extension:UserMagic
- Extension:UILangCode
- Extension:LanguageCode
![]() | This extension is included in the following packages and/or wiki farms: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
Categories:
- Extensions by WikiTeq
- Stable extensions
- Variable extensions
- GPL licensed extensions
- Extensions in Wikimedia version control
- GetMagicVariableIDs extensions
- ParserFirstCallInit extensions
- ParserGetVariableValueSwitch extensions
- ParserOptionsRegister extensions
- All extensions
- Extensions included in Canasta
- Extensions included in Miraheze
- Extensions included in MyWikis
- Extensions included in Open CSP
- Extensions included in ProWiki
- Extensions included in wiki.gg
- Extensions included in WikiForge