დახმარება:ცვლადები
რედაქტირება |
---|
ახალი გვერდის შექმნა |
Page name |
Referencing |
Links |
Piped links |
Interwiki linking |
Footnotes (References) |
ფორმატირება |
Wikitext |
სიები და ცხრილები |
Image & file uploads |
Formulae |
Organising |
Sections |
Categories |
Redirects (forward) |
Namespaces |
Moving a page |
Page size |
Fixing mistakes |
Reverting edits |
წინასწარ გადახედვა |
Saving effort |
Editing shortcuts |
Edit toolbar |
ჯადოსნური სიტყვები |
Templates |
ცვლადები |
Calculation |
Communicating |
რეზიუმეს ველი |
Talk page |
რედაქტირების კონფლიქტი |
მცირე შესწორება |
Other |
Characters |
სავარჯიშო |
漢>ა A>ა | ეს სტატია/სექცია ქართულ ენაზე თარგმნის პროცესშია. თუ ფლობთ ამ ენას, თქვენც შეგიძლიათ მონაწილეობის მიღება. |
A variable can be considered a predefined template without parameters. See also Help:Parser function.
This is a list of variables that can be used in the wikitext. The way they are rendered may vary with time (directly depending on time, or e.g. for number of articles, depending on the creation of other articles), on the project (it changes when the wikitext is copied), or on the page in which it occurs (it changes when the wikitext is copied, when the page is renamed, and when the page is included in another page).
On the left is the variable, on the right how it is rendered at this time, in this project, on this page.
The names of the variables form part of the set of so-called "ჯადოსნური სიტყვები" the system uses.
With Special:ExpandTemplates one can view the value of a variable, or more generally, the expanded wikitext a variable or a wikitext with variables and/or template calls produces, as intermediate step toward rendering.
ცვლადები
რედაქტირებამუდმივები, სტანდარტული ცვლადები
რედაქტირებაცვლადი | მაგალითი | აღწერა |
---|---|---|
{{SITENAME}} | ვიკიპედია | საიტის სახელწოდება |
{{SERVER}} | //ka.wikipedia.org | სერვერის მისამართი |
{{SERVERNAME}} | ka.wikipedia.org | სერვერის სახელწოდება |
{{CURRENTVERSION}} | 1.44.0-wmf.6 (d77bde6) | მედიავიკის ვერსია |
{{CONTENTLANGUAGE}} | ka | პროექტის ენა |
გვერდზე დამოკიდებული ცვლადები
რედაქტირებაკოდი | მაგალითი | აღწერა |
---|---|---|
{{PAGENAME}} | ცვლადები
|
Returns the name of the current page, including all levels (Title/Subtitle). This does not include the name of the namespace. |
{{PAGENAMEE}} | %E1%83%AA%E1%83%95%E1%83%9A%E1%83%90%E1%83%93%E1%83%94%E1%83%91%E1%83%98
|
More URL-friendly percent encoded special characters (To use an articlename in an external link). |
{{SUBPAGENAME}} {{SUBPAGENAMEE}} |
ცვლადები
|
[MW1.6+] Name of the current page, excluding parent pages ("Subtitle" on "Title/Other/Subtitle") in namespaces supporting subpages, see Help:Link. |
{{BASEPAGENAME}} {{BASEPAGENAMEE}} |
ცვლადები
|
[MW1.7+] The basename of a subpage ("Title/Other" on "Title/Other/Subtitle"), see Help:Link. |
{{NAMESPACE}} {{NAMESPACEE}} |
დახმარება
|
Returns the name of the namespace the current page resides in. |
{{FULLPAGENAME}} {{FULLPAGENAMEE}} |
დახმარება:ცვლადები
|
[MW1.6+] Shorthands for NAMESPACE+PAGENAME |
{{TALKSPACE}} {{TALKSPACEE}} |
დახმარების განხილვა
|
[MW1.7+] Name of next odd namespace (e.g. 4 => 5) |
{{SUBJECTSPACE}} {{SUBJECTSPACEE}} |
დახმარება
|
[MW1.7+] Name of last even namespace (e.g. 5 => 4) |
{{ARTICLESPACE}} {{ARTICLESPACEE}} |
დახმარება
|
[MW1.7+] An alias for SUBJECTSPACE(E) |
{{TALKPAGENAME}} {{TALKPAGENAMEE}} |
დახმარების განხილვა:ცვლადები
|
[MW1.7+] FULLPAGENAME in its TALKSPACE |
{{SUBJECTPAGENAME}} {{SUBJECTPAGENAMEE}} |
დახმარება:ცვლადები
|
[MW1.7+] FULLPAGENAME in its SUBJECTSPACE |
{{ARTICLEPAGENAME}} {{ARTICLEPAGENAMEE}} |
დახმარება:ცვლადები
|
[MW1.7+] An alias for SUBJECTPAGENAME(E) |
{{REVISIONID}} | -
|
[MW1.5+] The unique identifying number of a page, see Help:Diff. Note that when editing a page, this value is null. |
{{REVISIONDAY}} | 18
|
[MW1.8+] The day on which the page was last modified. |
{{REVISIONDAY2}} | 18
|
[MW1.8+] The day on which the page was last modified, but with a leading zero (01 .. 31). |
{{REVISIONMONTH}} | 11
|
[MW1.8+] The month in which the page was last modified. |
{{REVISIONYEAR}} | 2007
|
[MW1.8+] The year in which the page was last modified. |
{{REVISIONTIMESTAMP}} | 20071118180825
|
[MW1.8+] ISO 8601 time stamp, indicating when the page was last modified. |
{{SITENAME}} | ვიკიპედია
|
Value of თარგი:H:mwg. |
{{SERVER}} | //ka.wikipedia.org | Value of თარგი:H:mwg |
{{SCRIPTPATH}} | /w
|
[MW1.5+] თარგი:H:mwg |
{{SERVERNAME}} | ka.wikipedia.org
|
[MW1.5+] თარგი:H:mwg |
For the rendering on page A, these variables depend on page A, even if page A contains the variable due to inclusion of page B. Variables in the sort key of a category tag refer to the page with the tag, not the category page where it takes effect.
{{NAMESPACE}} and {{NAMESPACEE}} return an empty string in the article namespace {{ns:0}}, see above and NS:0.
PAGENAMEE displays the page title in the form that is used in URLs, i.e. with underscores for spaces, and percent-encoding for special characters, and is therefore used for constructing URLs incl. query strings.
For example, on Template talk:!, SUBJECTPAGENAMEE would produce Template:%21. Don't encode PAGENAMEE etc. again, i.e. don't use it in the first parameter of fullurl: and similar parser functions, {{urlencode:%21}} = %2521 probably won't work as expected. Query strings in PURL redirections are an exception.
The "EE" encoding examples shown above for this page are not very interesting, only TALKPAGENAMEE and TALKSPACEE differ from TALKPAGENAME and TALKSPACE. See Help:Link and დახმარება:ჯადოსნური სიტყვები for other examples.
In a subpage, [[../]] renders as a link to the parent page. For example, on m:Link/a/b it gives an internal link to m:Link/a, see Help:Link#Subpage feature.
{{ REVISIONID
}} = - showing the current unique revision number of a saved page as used for diffs in the page history is in essence useless, it can't be substituted and also doesn't work in preview.
დრო
რედაქტირებაThe time in UTC. Note that if the page was displayed by the same user and has not changed (page has not been edited) since the last time it was displayed, it is possible that the page may be cached (by the user's browser) and the displayed time or date may not change. Also, if a heavily used page, rather than freshly rendered by the software each time it is generated, is instead being retrieved from a caching system (such as the main page on Wikipedia) the date or time may not change from the last time the page was originally retrieved by the caching hardware or software.
Local time
The time depending on the local timezone of the wiki (not depending on the timezone in the user's preference settings). (All words [MW1.8+] )
- See also the ParserFunction #time:
Time variables which change more often than once a day are generally useful only as curiosities. Because of the way article HTML is cached, these variables may be wrong by up to 24 hours, and so are not a reliable way to tell the user the current time.
Please note that a template using more than one CURRENT variable directly or indirectly is suspicious. There can be critical races near hh:mm:59.
The following code to determine the minute can produce spurious results if the timestamp changes during the evaluation:
{{#expr:(( {{CURRENTTIMESTAMP}}-{{CURRENTTIMESTAMP}} mod 100)/100) mod 100}} = 3
This is actually an intermittent bug with MOD depending on the size (not the value) of CURRENTTIMESTAMP, see თარგი:Tim.
- CURRENTDOW
- 0=Sunday, 1=Monday, .. 6=Saturday.
- CURRENTWEEK
- is the number of the current week (1-53) according to ISO 8601 with no leading zero.
- CURRENTDAY2
- adds a leading zero to days 1...9, this allows to construct the ISO date formats like 2024-12-18T18:03Z.
- CURRENTMONTHNAMEGEN
- is the genitive grammatical form of the month name (used in Finnish თარგი:Unclear and in Slovenian).
- NUMBEROFARTICLES
- see Help:Article count and Special:Statistics..
მთვლელები
რედაქტირება- იხილეთ ასევე: სტატისტიკა
ცვლადი | მაგალითი | აღწერა |
---|---|---|
{{NUMBEROFEDITS}} | 4 717 931 | შეტანილი ცვლილებების (არსებული ვერსიების) რაოდენობა |
{{NUMBEROFPAGES}} | 492 585 | არსებული გვერდების მთლიანი რაოდენობა |
{{NUMBEROFARTICLES}} | 176 934 | სტატიების სრული რაოდენობა |
{{NUMBEROFFILES}} | 15 921 | ფაილების რაოდენობა (სურათები და ა.შ.) |
{{NUMBEROFUSERS}} | 165 377 | დარეგისტრირებულ მომხმარებელთა რაოდენობა |
{{NUMBEROFADMINS}} | 6 | ადმინისტრატორების რაოდენობა |
Substitution
რედაქტირება- Main article: Help:Substitution
When {{<includeonly>subst:</includeonly>CURRENTTIMESTAMP}}
is included and thereby substituted, the timestamp of doing that is put in the wikitext, and similarly for other variables. Examples:
{{CURRENTTIMESTAMP}}
- 20241218180355 - stays a variable on pages including the template
{{subst:CURRENTTIMESTAMP}}
- 20060526024210 - became a substituted constant in the template
{{<includeonly>subst:</includeonly>CURRENTTIMESTAMP}}
- 20241218180355 - becomes a constant at the time of its inclusion
Templates with the "includeonly subst magic" must also be subst-ed.
Examples of combinations with parser functions
რედაქტირება{{fullurl:{{FULLPAGENAME}}|action=edit}}
- //ka.wikipedia.org/w/index.php?title=%E1%83%93%E1%83%90%E1%83%AE%E1%83%9B%E1%83%90%E1%83%A0%E1%83%94%E1%83%91%E1%83%90:%E1%83%AA%E1%83%95%E1%83%9A%E1%83%90%E1%83%93%E1%83%94%E1%83%91%E1%83%98&action=edit
{{fullurl:w:en:Special:Whatlinkshere|target={{NAMESPACE}}:Contents}}
- https://en.wikipedia.org/wiki/en:Special:Whatlinkshere?target=დახმარება:Contents
{{fullurl:m:Special:Whatlinkshere|target={{FULLPAGENAME}}}}
- https://meta.wikimedia.org/wiki/Special:Whatlinkshere?target=დახმარება:ცვლადები
{{fullurl:{{FULLPAGENAME}}|action=edit}}
- //ka.wikipedia.org/w/index.php?title=%E1%83%93%E1%83%90%E1%83%AE%E1%83%9B%E1%83%90%E1%83%A0%E1%83%94%E1%83%91%E1%83%90:%E1%83%AA%E1%83%95%E1%83%9A%E1%83%90%E1%83%93%E1%83%94%E1%83%91%E1%83%98&action=edit
[[{{NAMESPACE}} განხილვა:{{PAGENAME}}]]
- დახმარება განხილვა:ცვლადები
{{fullurl:{{NAMESPACE}} განხილვა:{{PAGENAME}}}}
- //ka.wikipedia.org/wiki/%E1%83%93%E1%83%90%E1%83%AE%E1%83%9B%E1%83%90%E1%83%A0%E1%83%94%E1%83%91%E1%83%98%E1%83%A1_%E1%83%92%E1%83%90%E1%83%9C%E1%83%AE%E1%83%98%E1%83%9A%E1%83%95%E1%83%90:%E1%83%AA%E1%83%95%E1%83%9A%E1%83%90%E1%83%93%E1%83%94%E1%83%91%E1%83%98
The old form {{SERVER}}{{localurl:
page }}
is in essence the same as
{{fullurl:
page }}
in recent (1.5+) versions of the software.
In a template, for a link to a page which depends on a template parameter, the external link style is used even for internal links, to avoid that the system links to the edit page even if the page exists. To construct the external link, variables can also be useful.
Variable in the form of a template call
რედაქტირებაIf the syntax of a template call with parameters is applied with the name of a variable, depending on the variable the parameters are either ignored or cause the variable to be interpreted as a (non-existing) template:
- Variables like {{NUMBEROFPAGES:R}} = 492585 with a "raw" format are always handled as variable, {{NUMBEROFPAGES:R|Para|meter}} = 492585.
- Other variables like {{CURRENTDAYNAME}} = ოთხშაბათი are handled as template for given parameter(s), {{CURRENTDAYNAME|x}} = თარგი:CURRENTDAYNAME.
- Parser functions like {{lc: Lower Case}} = lower case ignore extraneous parameters, {{lc: Lower|Case}} = lower.
- Parser function ns (e.g. {{ns: 1}} = განხილვა) gives an empty string for a non-applicable numerical parameter value, and evaluates in the case of a non-numerical parameter value as template (the template name being the whole text until "|" or "}}"):
- {{ns: 1234}} =
- {{ns: t|abc}} = თარგი:Ns: t
- Parser functions like fullurl don't support the ../ notation, and in namespaces supporting subpages this has odd effects: like above, they evaluate such an invalid parameter value as template, see Link/a and Link/a/b. Here it just renders the wikitext:
- {{fullurl:../a}} = თარგი:Fullurl:../a.
- The cases #2, #4, and #5 resulting in template calls are probably related.
Adding new variables
რედაქტირებაA simple means of adding new MediaWiki variables is to add the following code to the LocalSettings.php file. This code also adds two example variables, CURRENTUSER and LOGO. It uses the ParserGetVariableValueSwitch hook which was added into MediaWiki 1.60, so for earlier versions you will have to add the hook manually into the /includes/Parser.php script in the getVariableValue function. See MW:Extension:Variables for the code to add new variables.
See also
რედაქტირება- Help:Parser function - a way of integrating with the parser more tightly since version 1.7.0
- Help:Substitution - on applying "subst" to a variable or to a template using a variable
- MagicWord.php