උදවු:Variables
Variables return information about the current page, wiki, or date. Their syntax is similar to templates.
Most variables (except for pseudo variables below) are types of "magic words". See magic words at MediaWiki for a complete list.
Date and time
[සංස්කරණය]The following variables return the current date and time in UTC.
Due to software and browser caching, these variables frequently show when the page was cached rather than the current time.
Variable | Output | Description |
---|---|---|
{{CURRENTYEAR}} | 2024 | Year |
{{CURRENTMONTH}} | 11 | Month (zero-padded number) |
{{CURRENTMONTHNAME}} | නොවැම්බර් | Month (name |
{{CURRENTMONTHNAMEGEN}} | නොවැම්බර් | Month (genitive form) |
{{CURRENTMONTHABBREV}} | නොවැ | Month (abbreviation) |
{{CURRENTDAY}} | 21 | Day of the month (unpadded number) |
{{CURRENTDAY2}} | 21 | Day of the month (zero-padded number) |
{{CURRENTDOW}} | 4 | Day of the week (unpadded number) |
{{CURRENTDAYNAME}} | බ්රහස්පතින්දා | Day of the week (name) |
{{CURRENTTIME}} | 22:00 | Time (24-hour HH:mm format) |
{{CURRENTHOUR}} | 22 | Hour (24-hour zero-padded number) |
{{CURRENTWEEK}} | 47 | Week (number) |
{{CURRENTTIMESTAMP}} | 20241121220024 | YYYYMMDDHHmmss timestamp |
Technical metadata
[සංස්කරණය]Revision variables return data about the latest edit to the current page, even if viewing an older version of the page.
Site
[සංස්කරණය]Variable | Output | Description |
---|---|---|
{{SITENAME}} | Wikibooks | The wiki's site name |
{{SERVER}} | //si.wikibooks.org | domain URL |
{{SERVERNAME}} | si.wikibooks.org | domain name |
{{SCRIPTPATH}} | /w | relative script path |
{{STYLEPATH}} | /w/skins | relative style path |
{{CURRENTVERSION}} | 1.44.0-wmf.4 (a8dd895) | The wiki's MediaWiki version. |
{{CONTENTLANGUAGE}} {{CONTENTLANG}} |
si si |
The wiki's default interface language |
Latest revision to current page
[සංස්කරණය]Variable | Output | Description |
---|---|---|
{{REVISIONID}} | - | Unique revision ID |
{{REVISIONDAY}} | 5 | Day edit was made (unpadded number) |
{{REVISIONDAY2}} | 05 | Day edit was made (zero-padded number) |
{{REVISIONMONTH}} | 04 | Month edit was made (zero-padded number) |
{{REVISIONYEAR}} | 2023 | Year edit was made |
{{REVISIONTIMESTAMP}} | 20230405070133 | Timestamp as of time of edit |
{{REVISIONUSER}} | Pinthura | The username of the user who made the most recent edit to the page, or the current user when previewing an edit |
Statistics
[සංස්කරණය]Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}}
→ 12,559 and {{NUMBEROFPAGES:R}}
→ 12559). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example {{PAGESINCATEGORY:Help}}
and {{PAGESINCATEGORY:Help|R}}
).
Variable | Output | Description |
---|---|---|
{{NUMBEROFPAGES}} | 12,559 | Number of wiki pages. |
{{NUMBEROFARTICLES}} | 961 | Number of pages in content namespaces. |
{{NUMBEROFFILES}} | 60 | Number of uploaded files. |
{{NUMBEROFEDITS}} | 31,233 | Number of page edits. |
{{NUMBEROFUSERS}} | 3,580 | Number of registered users. |
{{NUMBEROFADMINS}} | 2 | Number of users in the administrator group. |
{{NUMBEROFACTIVEUSERS}} | 11 | Number of active users, based on the criteria used in Special:Statistics. |
{{NUMBERINGROUP:groupname}} {{NUMINGROUP:groupname}} |
0 0 ({{NUMBERINGROUP:bureaucrat}} used here) |
Number of users in a specific group. |
Namespaces
[සංස්කරණය]Variable | Output | Description |
---|---|---|
{{NAMESPACE}} | උදවු | Name of the page's namespace |
{{SUBJECTSPACE}} {{ARTICLESPACE}} |
උදවු උදවු |
Name of the associated content namespace |
{{TALKSPACE}} | උදවු සාකච්ඡාව | Name of the associated talk namespace |
The following are equivalents encoded for use in URLs (spaces replaced with underscores and some characters percent-encoded):
- {{NAMESPACEE}}
- {{SUBJECTSPACEE}}
- {{TALKSPACEE}}
These can take a page name and will return the namespace of the page name parameter, instead of the current page's:
- {{NAMESPACE:Template:Main Page}} → සැකිල්ල
- {{SUBJECTSPACE:Template:Main Page}} → සැකිල්ල
- {{TALKSPACE:Template:Main Page}} → සැකිලි සාකච්ඡාව
Page names
[සංස්කරණය]Variable | Output | Description |
---|---|---|
{{FULLPAGENAME}} | උදවු:Variables | Namespace and page title. |
{{PAGENAME}} | Variables | Page title, excluding namespace. |
{{BASEPAGENAME}} | Variables | Page title excluding the current subpage and namespace ("Title/foo" on "Title/foo/bar"). |
{{SUBPAGENAME}} | Variables | The subpage title ("foo" on "Title/foo"). |
{{ROOTPAGENAME}} | Variables | Title of the topmost parent, excluding namespace and anything after the first slash ("Title" on "Wikijunior:Title/foo/bar"). |
{{SUBJECTPAGENAME}} | උදවු:Variables | The namespace and title of the associated content page. |
{{TALKPAGENAME}} | උදවු සාකච්ඡාව:Variables | The namespace and title of the associated talk page. |
The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters percent-encoded):
- {{FULLPAGENAMEE}}
- {{PAGENAMEE}}
- {{BASEPAGENAMEE}}
- {{SUBPAGENAMEE}}
- {{ROOTPAGENAMEE}}
- {{SUBJECTPAGENAMEE}}
- {{TALKPAGENAMEE}}
These can all allow specification of the page to be operated on, instead of just the current page:
- {{PAGENAME:Template:Main Page}} → Main Page
Pseudo variables
[සංස්කරණය]Some templates have been created that mimic the above variables. While the variables in the above section use a colon (:) to specify a page for output if desired, these will use a pipe (|) for inputting a page. For example, {{BOOKNAME|Wikijunior:Bugs}}
can be used to get Wikijunior:Bugs.
Template | Description |
---|---|
{{NUMBEROFBOOKS}} | Returns the number of books at Wikibooks. |
{{BOOKTEMPLATE}} | Returns the name of a template with the same name as the book it's used in. |
{{BOOKNAME}} | Returns the name of the book associated with the page on which it's used. |
{{NAIVEBOOKNAME}} | Returns the namespace and rootpagename of the page. |
{{BOOKTALKNAME}} | Returns the associated discussion page for a book as a whole. |
{{CHAPTERNAME}} | Returns the chapter that a page is in and ignores anything beyond that. |
{{BOOKPAGENAME}} | Returns all of a page name except the name of the book. |
{{BOOKSORTKEY}} | Returns all of a subpage name except the name of the book, or the book name if the page isn't a subpage. |
For the latter templates, it's easier to see the difference between them by viewing a side-by-side comparison of their outputs.
Template | Chess/Puzzles/Directmates | Wikijunior:Dinosaurs/Apatosaurus | Category:Book:Horticulture/Templates/Boxes | Wikijunior talk:Bugs/Shield Bug |
---|---|---|---|---|
{{BOOKNAME}} | Chess | Wikijunior:Dinosaurs | Book:Horticulture | Wikijunior talk:Bugs |
{{NAIVEBOOKNAME}} | Chess | Wikijunior:Dinosaurs | ප්රවර්ගය:Book:Horticulture | Wikijunior talk:Bugs |
{{BOOKTALKNAME}} | සාකච්ඡාව:Chess | සාකච්ඡාව:Wikijunior:Dinosaurs | සාකච්ඡාව:Book:Horticulture | සාකච්ඡාව:Wikijunior talk:Bugs |
{{CHAPTERNAME}} | Puzzles | Apatosaurus | Templates | Shield Bug |
{{BOOKPAGENAME}} | Puzzles/Directmates | Apatosaurus | Templates/Boxes | Shield Bug |
{{BOOKSORTKEY}} | Puzzles/Directmates | Apatosaurus | Templates/Boxes | Shield Bug |
This page was moved from . Its edit history can be viewed at උදවු:Variables/edithistory