Help:Ru/Templates: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Language subpage|title=Помощь:Шаблоны}}
{{Language subpage|title=Помощь:Шаблоны}}
{{Translate}}
{{Translate}}
'''Шаблон''' это страница, созданная для использования на других страницах. Шаблоны обычно содержат повторяющуюся информацию, которая может потребоваться для отображения в большем количестве статей или страниц. Они обычно используются для создания стандартных сообщений, предупреждений или уведомлений, информационных блоков, навигационных панелей и тому подобных целей.


Шаблоны позволяют выполнять действия намного быстрее и/или проще. Шаблоны очень часто используются на страницах, поэтому лучше узнать о них. Когда вики видит на странице распознанный ею шаблон, она автоматически заменяет его другим. Что там появится, зависит от пользователей.
Шаблоны позволяют создавать страницы намного быстрее иудобнее. Шаблоны очень часто используются на страницах, поэтому лучше узнать о них заранее. Когда платформа Wiki определяет шаблон при обработке страницы, он автоматически заменяется соотвествующим содержимым. Что там появится, зависит от пользователей.
<div style="float:right;clear:right;padding:0 1em;background:#303030;border:1px gray solid">
*[[Help:Templates#Как использовать шаблон|Как использовать шаблон]]
*[[Help:Templates#Making templates|Making templates]]
*[[Help:Templates#Templates not updating|Templates not updating]]
*[[Help:Templates#Template shortcuts|Template shortcuts]]
*[[Help:Templates#Useful templates|Useful templates]]
*[[Help:Templates#Magic words|Magic words]]
*[[Help:Templates#See Also|See Also]]
</div>


== Как использовать шаблон ==
== Как использовать шаблон ==
Line 21: Line 13:


{{Note|Любая страница может быть исключена другой страницей. Ниже приведено исключение [[Main Page|главной страницы]]:}}
{{Note|Любая страница может быть исключена другой страницей. Ниже приведено исключение [[Main Page|главной страницы]]:}}
{{ExpandBox:ru|{{:Main Page}}}}
{{Note|Any page can be transcluded by another one actually. A transclusion of the [[Main Page]] can be done using {{tlc|&#58;Main Page}}, but we don't do this here because it would add all of the headlines of the Main Page to the table of contents of this page.}}


=== Примеры ===
=== Примеры ===
Вот шаблон, в котором мы не определяем никаких параметров, вы просто вставляете его прямо в шаблон.
Вот шаблон, в котором мы не определяем никаких параметров, вы просто вставляете его прямо в шаблон.
<pre>{{restart:ru}}</pre>
<pre>{{restart}}</pre>
Результат: {{restart:ru}}
Результат: {{restart}}


Если вы посетите [[Template:Restart:ru|страницу этого шаблона]], то увидите, что в нём всего пять слов.
Если Вы посетите [[Template:Restart|страницу этого шаблона]], то увидите, что в нём всего пять слов.




Line 37: Line 29:
Безымянные параметры должны быть определены в определённом порядке.
Безымянные параметры должны быть определены в определённом порядке.


===Substitution (for advanced users)===
===Подстановка (для опытных)===
Instead of transcluding a template, one can choose to ''substitute'' it. Substitution will replace a template with the contents ''of'' the template directly onto the page. To substitute a template, transclude it like you normally would, then add <code>subst:</code> between <code>{{</code> and the template's name. After that, click the save button and the wikitext will automatically be added. Do not substitute carelessly, because the substituted wikitext will not be updated when the template is. See [[Wikipedia:Help:Substitution]] for more information.
Instead of transcluding a template, one can choose to ''substitute'' it. Substitution will replace a template with the contents ''of'' the template directly onto the page. To substitute a template, transclude it like you normally would, then add <code>subst:</code> between <code>{{</code> and the template's name. After that, click the save button and the wikitext will automatically be added. Do not substitute carelessly, because the substituted wikitext will not be updated when the template is. See [[Wikipedia:Help:Substitution]] for more information.
<pre>{{subst:delete|This is a bad page.}}</pre>
<pre>{{subst:delete|This is a bad page.}}</pre>
Line 44: Line 36:
Note the automatic forwarding of parameters. When substituting, the page should not appear any differently than it would if transcluded. The only difference is in the page code.
Note the automatic forwarding of parameters. When substituting, the page should not appear any differently than it would if transcluded. The only difference is in the page code.


==Making templates==
==Сошдание шаблонов==
Making a template like [[Template:Restart]] is rather easy - just type the text you want, and save it. What about ones with parameters?
Making a template like [[Template:Restart]] is rather easy - just type the text you want, and save it. What about ones with parameters?


{{tip|When making templates, you may want to space out your code to make it easier to read, but watch out for unintentional whitespace. HTML comments (<code><nowiki><!-- --></nowiki></code>) can also be useful.}}
{{tip|When making templates, you may want to space out your code to make it easier to read, but watch out for unintentional whitespace. HTML comments (<code><nowiki><!-- --></nowiki></code>) can also be useful.}}


===Unnamed parameters===
===Безымянные параметры===
To add an unnamed parameter, simply put <code>{{{1}}}</code> where you want it to be.
To add an unnamed parameter, simply put <code>{{{1}}}</code> where you want it to be.


Line 66: Line 58:
Result: {{distinguish|Combine|Civil Protection|Overwatch}}
Result: {{distinguish|Combine|Civil Protection|Overwatch}}


===Named parameters===
===Именованные параметры===
Usually you would want to have named parameters affect anything only if they are defined when being transcluded. We'll talk about conditions later. For now, let's look at [[Template:IO]], which has many named parameters. In this template, <code>{{{param}}}</code> marks a place to add wikitext that's defined by <code>|param=texthere</code> when transcluding.
Usually you would want to have named parameters affect anything only if they are defined when being transcluded. We'll talk about conditions later. For now, let's look at [[Template:IO]], which has many named parameters. In this template, <code>{{{param}}}</code> marks a place to add wikitext that's defined by <code>|param=texthere</code> when transcluding.


Line 78: Line 70:
Result: {{IO|SetString|Updates the string.}}
Result: {{IO|SetString|Updates the string.}}


===Default value===
===Значение по умолчанию===
To make a parameter have a value by default, add a <code>|</code> to the right of the parameter name, and then define the value. Named ''and'' unnamed parameters can use this.
To make a parameter have a value by default, add a <code>|</code> to the right of the parameter name, and then define the value. Named ''and'' unnamed parameters can use this.
<pre>{{{1|3000}}}</pre>
<pre>{{{1|3000}}}</pre>
Line 85: Line 77:
This returns nothing. Without the <code>|</code>, it would literally return "{{{value}}}" as text, if it hasn't already been defined at some other point.
This returns nothing. Without the <code>|</code>, it would literally return "{{{value}}}" as text, if it hasn't already been defined at some other point.


===Parser Functions===
===Функции анализатора===
<code>#if:</code> checks if a string or parameter has anything inside it.
<code>#if:</code> checks if a string or parameter has anything inside it.
<pre>{{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }}</pre>
<pre>{{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }}</pre>
Line 113: Line 105:
Result: {{#ifexpr: 6 + 3 = 23 | Right | Wrong }}
Result: {{#ifexpr: 6 + 3 = 23 | Right | Wrong }}


===Documentation===
===Документация===
Please give a description of what your template is, and maybe examples. To keep this describing text from appearing on pages, there are 3 different HTML tags you can use.
Please give a description of what your template is, and maybe examples. To keep this describing text from appearing on pages, there are 3 different HTML tags you can use.


Line 124: Line 116:
They can sound very confusing at first. If you're confused on how to use them, check the source code for a template, because almost all use them for one purpose or another.
They can sound very confusing at first. If you're confused on how to use them, check the source code for a template, because almost all use them for one purpose or another.


==Templates not updating==
===Шаблоны не обновляются===
If you've recently edited a template and the changes are not applying on pages it's been transcluded to, add <code>?action=purge</code> at the end of the URL for those pages. This will tell the server to update the page's HTML immediately. You can achieve the same effect by editing a page and saving it without making any changes.
If you've recently edited a template and the changes are not applying on pages it's been transcluded to, add <code>?action=purge</code> at the end of the URL for those pages. This will tell the server to update the page's HTML immediately. You can achieve the same effect by editing a page and saving it without making any changes.


==Template shortcuts==
===Ярлыки шаблонов===
Some templates may have template shortcuts, which are redirects that are abbreviated or otherwise different forms of their target templates. Template shortcuts can be transcluded just like their target templates.
Some templates may have template shortcuts, which are redirects that are abbreviated or otherwise different forms of their target templates. Template shortcuts can be transcluded just like their target templates.


==Useful templates==
===Переводы===
All templates in '''{{style|color:#8BC53F|green text}}''' are that color so that they stand out against the greyscale tones of most pages. Most templates with that color also automatically add pages they are transcluded on into [[:Category:TODO]].
Templates should include translations so that people who natively speak other languages can more easily understand the contents of the template. There are two ways this can be accomplished.


===Per-game templates===
====Первый метод: {{tl|link=Autolang}}====
All games have templates that show their associated icon. (e.g. {{hl2}}) See [[:Category:Game icons]] for the full list. [[Template:Game link]] is a template that automatically links to a game's page and displays its icon next to it. (e.g. {{Game link|Half-Life 2}})
This is usually used on smaller templates with little text. This template automatically detects the language of the UI and gives the appropriate translation, if available. This is usually sufficient, however on larger templates it is usually recommended to use Method Two.


The <nowiki>{{since}}</nowiki> template can be used to quickly note features that were added in a game and are available in all Source games afterwards (e.g. {{since|{{portal2}}}}) The <nowiki>{{only}}</nowiki> template indicates features that are exclusive to a specific game (e.g. {{only|{{csgo}}}}).
====Второй метод: Подстраницы строк====
Larger templates (e.g. {{tl|link=Software page}}) tend to have large amounts of text, and having them all on one page makes it pointlessly cluttered and very hard to edit. To solve this, almost all text on these templates go on a Strings Subpage (e.g. {{tl|link=Software page/strings}}), which, when a specific string is specified, will present the appropriately translated text. This helps make not only text editing but translating much easier because editors don't have to shift through lots of code to find a small bit of text they want to edit/translate. This can he very complicated for smaller templates however, so it is usually reserved for larger templates.


The <nowiki>{{also}}</nowiki> template notes that earlier game also has a feature, usually backported from newer engine branches. These should be used with in conjunction with another game notice template (e.g. {{only|{{L4d}}}} {{also|{{GMOD}}}} or {{since|{{as}}}} {{also|{{GMOD}}}}).
{{Tip|You may see some templates still using the old suffix translation method. Keep in mind that this is no longer the preferred method and, if you know how, should be updated to use the current methods.}}


The <nowiki>{{removed}}</nowiki> template indicates that a feature was removed in a game and all later engine branches (e.g. {{removed|{{L4d}}}}).
==Полезные шаблоны==
All templates in '''{{style|color:#8BC53F|green text}}''' are that color so that they stand out against the greyscale tones of most pages. Most templates with that color also automatically add pages they are transcluded on into [[:Category:TODO]].


=======
===Именные шаблоны===
[[Template:=]] is a template that only returns an equal sign. The character is sometimes needed because multiple wiki features make use of it. An equal sign generated through this will never be counted as formatting.


===bug===
All games have templates named by their shortcut that can deliver their associated icon and/or a link to their page. See [[:Category:Game icons]] for a full list of game shortcuts. All of them accept the same set of parameters that are described on every template page. The following table should give examples and also give ideas on when to use them.
[[Template:Bug]] notifies readers of a [[Wikipedia:Software bug|bug]].
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
<pre>{{bug|The amount is double what it should be. Be careful!}}</pre>
! Wikitext
Result: {{bug|The amount is double what it should be. Be careful!}}
!colspan=3| Пример
! Описание
! Ранее используемый шаблон/Альтернатива
|-
| {{tlc|<shortcut>}} || {{tl2|hl2}}||→||{{hl2}} || Displays the game's icon which links to its game's page and shows the game's name as a hover text. Putting this at the beginning (or end) of a word or line is the shortest and most common way of clarifying that something applies only to a specific game, but there are more ways. ||
|-
| {{tlc|<shortcut>|2}} || {{tlc|hl2|2}}||→||{{hl2|2}} || Displays the game's icon followed by its name which both link to the game's page. Useful in sentences when the icon alone is too little but the next style is too much. || {{tl2|game link}} {{deprecated}}
|-
| {{tlc|<shortcut>|4}} || {{tlc|hl2|4}}||→||{{hl2|4}} || Does the same but using colorful text which grabs more attention, so don't overuse this on a page. Especially if you name the same game multiple times in a text, you definitely don't need a long, colorful link every time, let alone a link. || {{tl2|game name}} {{deprecated}}
|-
| {{tlc|<shortcut>|in}} || {{tlc|hl2|in}} ||→|| {{hl2|in}} || Can be used to indicate that something applies to a specific game. Useful at the end of a line or key word; The same applies to the following variants. || {{tl2|in}}
|-
| {{tlc|<shortcut>|since}} || {{tlc|portal2|since}} ||→|| {{portal2|since}} || Can be used to quickly note features that were added in a game and are available in all Source games afterwards. || {{tl2|since}}
|-
| {{tlc|<shortcut>|only}} || {{tlc|csgo|only}} ||→|| {{csgo|only}} || Indicates features that are exclusive to a specific game. || {{tl2|only}}
|-
| {{tlc|<shortcut>|also}} || {{tlc|as|since}}&nbsp;{{tlc|gmod|also}} ||→|| {{as|since}}&nbsp;{{gmod|also}} || Notes that earlier game also has a feature, usually backported from newer engine branches. These should be used with in conjunction with another game notice template. || {{tl2|also}}
|-
| {{tlc|<shortcut>|removed}} || {{tlc|l4d|removed}} ||→|| {{l4d|removed}} || Indicates that a feature was removed in a game and all later engine branches. || {{tl2|removed}}
|-
| {{tlc|<shortcut>|not}} || {{tlc|czds|not}} ||→|| {{czds|not}} || Indicates that a feature might be in other games but not in a specific one. || {{tl2|not}}
|}


===clarify===
=== Шаблоны внутренних заметок ===
[[Template:Clarify]] marks things that should be clarified.
<pre>PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}</pre>
Result: PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}


===cleanup===
The following are some of the [[:Category:inline note templates|inline note templates]].
[[Template:Cleanup]] marks a page that needs to be fixed up, preferably by someone knowledgeable. The text message is optional. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else.
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
<pre>{{cleanup|The last section needs to be clarified.}}</pre>
! Описание
Result: {{messagebox
! Wikitext и Результат
|text = This article needs to be '''cleaned up''' to conform to a higher standard of quality because:''' <p style="font-style: italic;">The last section needs to be clarified.</p>
|-
|small = For help, see the [[Help:Editing|VDC Editing Help]] and [[Wikipedia:Wikipedia:Cleanup_process#Advice_on_fixing_articles|Wikipedia cleanup process]]. Also, remember to check for any notes left by the tagger at this article's [[{{TALKPAGENAME}}|talk page]].  
| [[Template:Bug]] notifies readers of a [[Wikipedia:Software bug|bug]].
|image = [[File:broom_icon.png|40px|link=]]
| {{tlc|bug|The amount is double what it should be. Be careful!}}<br>{{bug|The amount is double what it should be. Be careful!}}
|bdcolor = #F4C430
|-
}}
| [[Template:Clarify]] marks things that should be clarified.
| <code>PAS is a kind of bounding-box for Player or NPC AI sound detection.{{tlc|clarify}}</code><br>PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}
|-
|rowspan=2| [[Template:Confirm]] marks something that needs to be confirmed. It's green color is meant to stand out.
| {{tlc|confirm|Always goes to the left.}}<br><div style="margin:0.4em 1em 0.5em;">{{confirm|Always goes to the left.}}</div>
|-
|<code>Always goes to the left.{{tlc|confirm}}</code><br>Always goes to the left.{{confirm}}
|-
| [[Template:Distinguish]] lets you notify users about pages that share similar names or may be confused for something else.
| {{tlc|distinguish|"Follow Freeman!"|desc1{{=}}The HL2 chapter}}<br>{{distinguish|"Follow Freeman!"|desc1=The HL2 chapter}}
|-
| [[Template:How]] asks the question ''how?''
| <code>Players can get past these.{{tlc|how}}</code><br>Players can get past these.{{how}}
|-
| [[Template:Idea]] is a nifty way to suggest ideas.
| {{tlc|idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}<br>{{idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}
|-
| [[Template:Main]] notes that there is a more detailed article about a certain topic.
| {{tlc|main|Soundscripts}}<br>{{main|Soundscripts}}
|-
| [[Template:Note]] is for making notes stand out more.
| {{tlc|note|This will spawn at the map origin if you do not specify the position.}}<br>{{note|This will spawn at the map origin if you do not specify the position.}}
|-
| [[Template:Question]] denotes a question
| {{tlc|question|Does this work in newer engine branches?}}<br>{{question|Does this work in newer engine branches?}}
|-
| [[Template:Suggestion]] is for suggesting something
| {{tlc|suggestion|Levels should be optimized for peak performance.}}<br>{{suggestion|Levels should be optimized for peak performance.}}
|-
| [[Template:Tip]] marks text as a tip to readers.
| {{tlc|tip|This is a much less tricky process when using the vertex edit tool as well.}}<br>{{tip|This is a much less tricky process when using the vertex edit tool as well.}}
|-
| [[Template:Todo]] marks things that need to be done. It's green color is meant to stand out.
| {{tlc|todo|Find where this is in the game files.}}<br><strong style="color:#8BC53F;white-space:nowrap;">To do:&nbsp;</strong>Find where this is in the game files.
|-
| [[Template:Warning]] marks things that readers should take caution of when doing something.
| {{tlc|warning|This tool has been known to corrupt files. Try an alternative listed below.}}<br>{{warning|This tool has been known to corrupt files. Try an alternative listed below.}}
|-
| [[Template:Workaround]] informs readers of a workaround
| {{tlc|workaround|This should be automated with logic instead.}}<br>{{workaround|This should be automated with logic instead.}}
|-
| [[Template:Why]] asks the question ''why?''
| <code>This shader has been deprecated.{{tlc|why}}</code><br>This shader has been deprecated.{{why}}
|}


===clr===
=== Шаблоны уведомлений ===
[[Template:Clr]] clears the vertical space to the left or right of something. This is commonly used for making headlines not get moved around by images.
The following is a list of some [[:Category:Notice_templates|notice templates]].
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
! Описание
!width=70%| Wikitext и Результат


[[File:Skull and crossbones.png|50px|frameless|left]]
|-
| {{tl2|Cleanup}} marks a page that needs to be fixed up, preferably by someone knowledgeable. The text message is optional. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else.
| {{tlc|cleanup|The last section needs to be clarified.}}<br>{{cleanup|nocat=1|The last section needs to be clarified}}


This text should appear next to the image. If you put <code><nowiki>{{clr}}</nowiki></code> right after this,
|-
| {{tl2|Delete}} marks a page that should be deleted. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. When putting this on a page, you should also list the reason on that page's talk page, for any future readers that may want to know the purpose of the deletion.
| {{tlc|delete}}{{delete|nocat=1}}
|-


this bit of text here will get moved down.
| {{tl2|Merge}} is a notice that notifies editors that it's been suggested for two or more pages to be combined into one. All merges should be discussed before being done.
----
| {{tlc|merge|HDR}}<br>{{merge|[[HDR]]|nocat=1}}
[[File:Skull and crossbones.png|50px|frameless|left]]
|-


This text should appear next to the image. If you put <code><nowiki>{{clr}}</nowiki></code> right after this,{{clr}}
| {{tl2|Split-apart}} marks pages that should be split into multiple pages. All splits should be discussed before being done.
| {{tlc|split-apart}}{{split-apart|nocat=1}}
|-


this bit of text here will get moved down.
| {{tl2|Moveto}} marks pages that should be moved to a different title, or sections of an article that should be moved to either another article or to their own new one. All moves should be discussed before being done.
| {{tlc|Moveto}}{{Moveto|nocat=1}}
|-


===confirm===
| {{tl2|screenshot}} marks pages that should have more images on them. It allows for an optional text message to clarify what needs images.
[[Template:Confirm]] marks something that needs to be confirmed. It's green color is meant to stand out.
| {{tlc|screenshot}}<br>{{screenshot|nocat=1}}
<pre>{{confirm|Always goes to the left.}}</pre>
Result: {{#if: Always goes to the left. | <div style="margin:0.4em 1em 0.5em;"><strong style="color:#8BC53F;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;">[[File:Confirm.png|link=|alt=]] Confirm:</strong><span style="display:table-cell;">Always goes to the left.</span></div> | <sup style="color:#8BC53F;">&#91;''confirm''&#93;</sup> }}
<pre>Always goes to the left.{{confirm}}</pre>
Result: Always goes to the left.{{#if:  | <div style="margin:0.4em 1em 0.5em;"><strong style="color:#8BC53F;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;">[[File:Confirm.png|link=|alt=]] Confirm:</strong><span style="display:table-cell;">{{{1}}}</span></div> | <sup style="color:#8BC53F;">&#91;''confirm''&#93;</sup> }}


===delete===
|-
[[Template:Delete]] marks a page that should be deleted. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. When putting this on a page, you should also list the reason on that page's talk page, for any future readers that may want to know the purpose of the deletion.
| {{tl2|Obsolete}} marks things that should no longer be used. Accepts three parameters, entity, tool, and shader.
<pre>{{delete|This is not a real thing.}}</pre>
| {{tlc|obsolete|entity{{=}}1}}<br>{{messagebox
Result: {{messagebox
|text = This entity is '''obsolete'''; its use is discouraged and it may only exist/function in older engine branches.
|text = '''This page is a [[Help:Deletion|candidate for speedy deletion]]{{#if: {{#if: This is not a real thing. | This is not a real thing. }} | &nbsp;because:''' <p style="font-style: italic;">{{#if: This is not a real thing. | This is not a real thing. }} </p>| .''' }}
|image = [[File:obsolete.png|40px|link=]]
  |bdcolor = #F4C430
}}


If you disagree with its speedy deletion, please explain why on [[{{NAMESPACE}} talk:{{PAGENAME}}|its talk page]].  If this page obviously does not meet the criteria for speedy deletion, or you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
|-
|small =
| {{tl2|Spammer}} marks users that should be banned for spamming. For suspicious but not bannable behavior, there is also [[Template:Minor Spammer]]. {{bug|This template's formatting may look weird sometimes. It's intended to be the only thing on a page.}}
''Administrators - Remember to check [[Special:Whatlinkshere/{{NAMESPACE}}:{{PAGENAME}}|if anything links here]] and [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=history}} the page history] ([{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|diff=0}} last edit]) before [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=delete}} deleting].''
| {{tlc|spammer}}<br>[[File:Spammer.jpg|left]]
|image = [[File:Warning_icon.png|40px|link=]]
<div style="overflow:auto;">
|bdcolor = #B22222
{{Note|''This user is a [[Wikipedia:Spammer|spammer]], [[Wikipedia:Vandalism|vandal]] or other problem poster and should be considered for a [[Special:Ipblocklist|ban]]''}}
}}
----
 
* [{{SERVER}}{{localurl:Special:Blockip|ip={{PAGENAMEE}}}}&wpBlockExpiry=infinite&wpHardBlock=1&wpAutoBlock=1&wpCreateAccount=0$wpBlockEmail=1&wpBlockReasonList=Spamming Block this user.] (Requires admin rights)
===distinguish===
* [{{SERVER}}{{localurl:Special:Log|type=block&page=User:{{PAGENAMEE}}}} Check if this user has been banned.]
[[Template:Distinguish:ru]] lets you notify users about pages that share similar names or may be confused for something else.
* [[Special:Contributions/{{PAGENAMEE}}|View this user's contributions.]]
 
</div>
Example from [[Follow Freeman]]:
<pre>{{distinguish:ru|"Follow Freeman!"|desc1=The HL2 chapter}}</pre>
Result: {{distinguish:ru|"Follow Freeman!"|desc1=The HL2 chapter}}


===ent===
|-
[[Template:Ent]] is a really small template for making text that's both code and a link.
| {{tl2|Banned user}} marks users that have been banned (usually by Valve employees) for spamming, vandalizing pages, edit warring or trolling along with many other reasons.
<pre>{{ent|noclip}}</pre>
| {{tlc|Banned user}}{{Banned user|nocat=1}}
Result: {{ent|noclip}}
|-


===ExpandBox===
| {{tl2|Stub}} marks pages that are very small. See [[Help:Stubs]] for info on using.
[[Template:ExpandBox:ru]] allows you to hide stuff inside a box that can be shrunk down so that it doesn't make pages as long.
| {{tlc|stub}}{{stub|nocat=1}}
<pre>{{ExpandBox:ru|{{:KV BaseEntity}}}}</pre>
Result: {{ExpandBox:ru|{{KV|Classname (classname)|string|The [[classname]] defines the type of entity.}}
:{{note|Classnames can be changed using [[AddOutput]], which will influence how the engine deals with the entity in certain circumstances.}}
{{KV|Name (targetname)|string|The [[targetname]] that other entities refer to this entity by. }}
{{KV|Global Entity Name (globalname)|string|Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.}}
{{KV|Parent (parentname)|targetname|Specifies a [[Entity Hierarchy (parenting)|movement parent]]. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.
:{{note|''Every'' entity can be parented, even point entities. Some entities which aren't intended to be parented may not function correctly. [[phys_constraint]] can be used as a workaround to parenting.}}
{{#if:  | {{warning|If a trigger does not start out with a parent but rather is assigned one dynamically, choose another entity and add it here as a dummy. Otherwise the trigger will stop colliding properly when it gets its real parent.}} }}
{{#if:  | {{warning|In {{game link|Counter-Strike: Source}}, [[Counter-Strike Source Entity Overview#Counter-Strike Round Restarts|parenting this entity to another can break the map]].}} }} }}
{{KV|Origin {X Y Z} (origin)|origin|The position of this entity's center in the world. Rotating entities typically rotate around their origin.}}
{{KV|Pitch Yaw Roll {Y Z X}  (angles)|angle|This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.}}
:{{note|This works on brush entities, although Hammer doesn't show the new angles.}}
{{KV|Hammer ID (hammerid)|string|The entity's [[Hammer]] ID. Mainly used by plugins and debugging commands, such as [[ent_keyvalue]].}} {{Not in FGD}}
{{KV|Effects (effects)|string|[[Effect flags]].}} {{Not in FGD}}
{{KV|Response Contexts (ResponseContext)|string|Pre-defined [[Response System|response system]] contexts for this entity. Format is <code>key:value,key:value,...</code>}}
:{{note|Despite the description, this works for ''all'' entities, although it is missing from most entities in the FGD.}}
{{#if:|
{{KV|Minimum CPU Level (mincpulevel)|int|Minimum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Maximum CPU Level (maxcpulevel)|int|Maximum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Minimum GPU Level (mingpulevel)|int|Minimum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Maximum GPU Level (maxgpulevel)|int|Maximum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
:<strong style="color:#8BC53F;white-space:nowrap;">To do{{#if: Better description for all of these. | &#58;&nbsp; }}</strong>Better description for all of these.
{{KV|Disable for Xbox 360 (disableX360)|bool|If Yes, disables this entity on the Xbox 360 version of Source. {{not in FGD}}|since=L4D}}
:{{#if: Playstation 3? | <div style="margin:0.4em 1em 0.5em;"><strong style="color:#8BC53F;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;">[[File:Confirm.png|link=|alt=]] Confirm:</strong><span style="display:table-cell;">Playstation 3?</span></div> | <sup style="color:#8BC53F;">&#91;''confirm''&#93;</sup> }}
| }}{{#if:||{{#if:||
{{KV|Minimum CPU Level (mincpulevel)|int|Minimum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Maximum CPU Level (maxcpulevel)|int|Maximum CPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Minimum GPU Level (mingpulevel)|int|Minimum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
{{KV|Maximum GPU Level (maxgpulevel)|int|Maximum GPU Level allowed for this entity. 0 means all levels allowed. {{not in FGD}}|since=L4D}}
:<strong style="color:#8BC53F;white-space:nowrap;">To do{{#if: Better description for all of these. | &#58;&nbsp; }}</strong>Better description for all of these.
{{KV|Disable for Xbox 360 (disableX360)|bool|If Yes, disables this entity on the Xbox 360 version of Source. {{not in FGD}}|since=L4D}}
:{{#if: Playstation 3? | <div style="margin:0.4em 1em 0.5em;"><strong style="color:#8BC53F;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;">[[File:Confirm.png|link=|alt=]] Confirm:</strong><span style="display:table-cell;">Playstation 3?</span></div> | <sup style="color:#8BC53F;">&#91;''confirm''&#93;</sup> }}
}}}}
{{#if:|
{{KV|Glow Backface Multiple (glowbackfacemult)|string|Unknown. {{l4d2}} only. {{not in FGD}}|since=L4D2}}
:<strong style="color:#8BC53F;white-space:nowrap;">To do{{#if: Documentation. | &#58;&nbsp; }}</strong>Documentation.
{{KV|Entity Scripts (vscripts)|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. |since=L4D2}}
{{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. {{note|Try to avoid expensive operations in this function, as it may cause performance problems.}}|since=L4D2}}
| }}{{#if:||{{#if:||
{{KV|Glow Backface Multiple (glowbackfacemult)|string|Unknown. {{l4d2}} only. {{not in FGD}}|since=L4D2}}
:<strong style="color:#8BC53F;white-space:nowrap;">To do{{#if: Documentation. | &#58;&nbsp; }}</strong>Documentation.
{{KV|Entity Scripts (vscripts)|scriptlist|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. |since=L4D2}}
{{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call. {{note|Try to avoid expensive operations in this function, as it may cause performance problems.}}|since=L4D2}}
}}}}
{{KV|Lag Compensation (LagCompensate)|boolean|Set to Yes to lag compensate this entity. Should be used very sparingly!|since=AS}}
{{#if:|
{{KV|Is Automatic-Aim Target (is_autoaim_target)|bool|If yes, automatic-aim assistance will target this entity. {{not in FGD}}|since=CSGO}}
| }}{{#if:||{{#if:||
{{KV|Is Automatic-Aim Target (is_autoaim_target)|bool|If yes, automatic-aim assistance will target this entity. {{not in FGD}}|since=CSGO}}
}}}}}}


===how===
|-
[[Template:How:ru]] asks the question ''how?''
| {{tl2|Translate}} marks pages where translation is needed and adds the page to a category.
<pre>Players can get past these.{{how}}</pre>
| {{tlc|Translate}}{{translate|nocat=1}}
Result: Players can get past these.{{how}}


===idea===
|-
[[Template:Idea:ru]] is a nifty way to suggest ideas.
| {{tl2|Update}} marks outdated pages.
<pre>{{idea:ru|Reward players for being clever and creative, instead of forcing things to be only one way.}}</pre>
| {{tlc|update}}{{update|nocat=1}}
Result: {{idea:ru|Reward players for being clever and creative, instead of forcing things to be only one way.}}


===merge===
|-
[[Template:Merge]] is a notice that notifies editors that it's been suggested for two or more pages to be combined into one. All merges should be discussed before being done.
| {{tl2|Wip}} marks pages that are in the middle of major edits. The adder requests that other users do not edit in the meantime.
<pre>{{merge|HDR}}</pre>
| {{tlc|Wip}}{{wip|nocat=1}}
Result: {{messagebox
|text = It has been suggested that this article or section be [[Wikipedia:Merging and moving pages|merged]] with ''[[HDR]]''. ([[talk:HDR|Discuss]])
|image = [[File:Merge-arrows.png|50px|link=]]
|bdcolor = #9932CC
}}


===messagebox===
|-
[[Template:Messagebox:ru]] provides a standard message box. This template is used by many notice templates, such as merge and cleanup.
| {{tl2|Draft}} marks pages that are currently being worked on.
<pre>{{messagebox:ru|text=Remember to follow wiki etiquette.}}</pre>
| {{tlc|draft}}{{draft|nocat=1}}
Result: {{messagebox|text=Remember to follow wiki etiquette.}}


===morescreenshots===
[[Template:Morescreenshots:ru]] marks pages that should have more images on them. It allows for an optional text message to clarify what needs images.
<pre>{{morescreenshots:ru|$envmapcontrast, $envmapsaturation}}</pre>
Result: {{messagebox
|text = This article or section needs additional screenshots for:'''<p style="font-style: italic;">$envmapcontrast, $envmapsaturation</p>| .
|small = You can upload screenshots at [[Special:Upload]]. For help, see the [[Help:Images]].
|image = [[File:Nuvola apps ksnapshot.png|50px|link=]]
|bdcolor = #F4C430
}}


===note===
|-
[[Template:Note:ru]] is for making notes stand out more.
| {{tl2|Rewrite}} marks pages that are being rewritten, usually with a wip version on another page.
{{bug:ru|Appears to not accept HTML tags inside it...?}}
| {{tlc|Rewrite|Help:Templates}}{{Rewrite|Help:Templates|nocat=1}}
<pre>{{Note|This will spawn at the map origin if you do not specify the position.}}</pre>
|}
Result: {{Note|This will spawn at the map origin if you do not specify the position.}}


===obsolete===
===Прочие шаблоны===
[[Template:Obsolete:ru]] marks things that should no longer be used. Accepts three parameters, entity, tool, and shader.
<pre>{{obsolete:ru|entity=1}}</pre>
Result: {{messagebox
|text = This entity is '''obsolete'''; its use is discouraged and it may only exist/function in older engine branches.
|image = [[File:obsolete.png|40px|link=]]
|bdcolor = #F4C430
}}


===MultiPage===
These templates have the purpose of helping the editor.
[[Template:MultiPage]] is used for linking to versions of pages in other languages. For an example of its use, see the [[Main Page]].
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
! Описание
!style=width:60%| Wikitext and Result
|-
|rowspan=2| [[Template:=]] is a template that only returns an equal sign. The character is sometimes needed because multiple wiki features make use of it. Especially, the equals sign is a special character in template calls, so if an equals sign should be passed as a parameter value, then {{tlc|{{=}}}} is needed for "escaping". For the same purpose, there is also [[Template:!]] for a pipe, [[Template:(((]] for curly brackets and many more, see [[:Category:Templates for within templates]].
| {{tlc|{{=}}}}<br>{{=}}
|-
| {{tlc|note|If x &#123;&#123;{{=}}&#125;&#125; 0, you lose.}}<br>{{note|If x {{=}} 0, you lose.}}


===shortcut===
|-
[[Template:Shortcut:ru]] displays a small box noting (abbreviated) redirects to a page.
| [[Template:Clr]] clears the vertical space to the left and right of floating tables, floating images etc. To clear only one side, use {{tlc|clr|left}} or {{tlc|clr|right}}. This is commonly used before headlines to push them down so that they don't appear next to an image. In the example on the right, one could also use {{tlc|clr|left}} for the same effect.
<pre>{{shortcut:ru|VDC:AL}}</pre>
| <code><nowiki>[[File:Skull and crossbones.png|50px|left]]
Result: {{shortcut:ru|VDC:AL}}
This text is next to the image.{{clr}}This text is below the image.</nowiki></code><br><br>
[[File:Skull and crossbones.png|50px|left]]
This text is next to the image.{{clr}}This text is below the image.


===spammer===
|-
[[Template:Spammer]] marks users that should be banned for spamming. {{bug:ru|This template's formatting may look weird sometimes. It's intended to be the only thing on a page.}}
| [[Template:Ent]] is a really small template for making text that's both code and a link.
<pre>{{spammer}}</pre>
| {{tlc|ent|noclip}}<br>{{ent|noclip}}
Result: [[File:Spammer.jpg|left]]
<div style="overflow:auto;">
{{Note|''This user is a [[Wikipedia:Spammer|spammer]], [[Wikipedia:Vandalism|vandal]] or other problem poster and should be considered for a [[Special:Ipblocklist|ban]]''}}
----
* [{{SERVER}}{{localurl:Special:Blockip|ip={{PAGENAMEE}}}}&wpBlockExpiry=infinite&wpHardBlock=1&wpAutoBlock=1&wpCreateAccount=0$wpBlockEmail=1&wpBlockReasonList=Spamming Block this user.] (Requires admin rights)
* [{{SERVER}}{{localurl:Special:Log|type=block&page=User:{{PAGENAMEE}}}} Check if this user has been banned.]
* [[Special:Contributions/{{PAGENAMEE}}|View this user's contributions.]]
</div>


===split-apart===
|-
[[Template:Split-apart:ru]] marks pages that should be split into multiple pages. All splits should be discussed before being done.
|rowspan=2| [[Template:Expand]] or [[Template:ExpandBox]] allows you to hide stuff inside a box that can be shrunk down so that it doesn't make pages as long.
<pre>{{split-apart:ru}}</pre>
| {{tlc|Expand|{{tlc|KV BaseEntity|noscroll{{=}}1}}}}<br>{{Expand|{{KV BaseEntity|noscroll=1}}}} <!-- doesn't inherit Categories, no need to subst: -->
Result:
{{messagebox
|text = It has been suggested that this article or section be [[Wikipedia:Wikipedia:Splitting|split]] into multiple articles. ([[:{{NAMESPACE}} talk:{{PAGENAME}}|Discuss]])
|image = [[File:Split-arrows.png|60px|link=]]
|bdcolor = #9932CC
}}


|-
| {{tlc|ExpandBox|{{tlc|KV BaseEntity|noscroll{{=}}1}}}}<br>{{ExpandBox|{{KV BaseEntity|noscroll=1}}}}


===stub===
|-
[[Template:Stub]] marks pages that are very small. See [[Help:Stubs]] for info on using.
| [[Template:MultiPage]] is used for translations, which replaced the deprecated {{t|Lang}} template, which stands for '''lang'''uage. This page itself uses the MultiPage template, using the wikitext {{tlc|MultiPage}}, and with the {{t|Language subpage}} template added to the language subpages (for example, it is located in [[Help:Templates/en]] for English language, containing everything else with the {{t|Language subpage}} template on top).<br><br>The {{t|MultiPage}}, and it's predecessor, {{t|Lang}} template creates flags at the top right corner of a page such as {{Flag|en}} {{Flag|ru}} {{Flag|zh}} and thus must be the first template to be transcluded to be in the right position.
<pre>{{stub}}</pre>
Result: {{messagebox
|text = This article is a [[Help:Stubs|stub]]. You can help by adding to it.
|image = None
}}


===tip===
Every page can and should use this template as it lets the reader know of the existence of (correctly titled) [[Valve Developer Community:Alternative Languages|language pages]] of the current page and clicking on the flags links to them. Read more on [[Template:MultiPage]].
[[Template:Tip:ru]] marks text as a tip to readers.
| {{tlc|lang|Help:Templates}}<br>''The result is at the very top of this page.''
<pre>{{tip:ru|This is a much less tricky process when using the vertex edit tool as well.}}</pre>
Result: {{tip:ru|This is a much less tricky process when using the vertex edit tool as well.}}


===toc-right===
|-
[[Template:toc-right:ru]] shifts the [[Help:Table of Contents|table of contents]] over to the right side of a page. For an example, see [[Half-Life 2 map reference]].
| [[Template:Param]] displays the values like parameters in the way that they are used in templates. Useful for template documentations.
| {{tlc|param|color|#fff}}<br>{{Param|color|#FFF}}


===todo===
|-
[[Template:Todo:ru]] marks things that need to be done. It's green color is meant to stand out.
| [[Template:Shortcut]] displays a small box noting (abbreviated) redirects to a page.
<pre>{{todo:ru|Find where this is in the game files.}}</pre>
| {{tlc|shortcut|VDC:AL}}<br>{{shortcut|VDC:AL}}
Result: <strong style="color:#8BC53F;white-space:nowrap;">To do{{#if: Find where this is in the game files. | &#58;&nbsp; }}</strong>Find where this is in the game files.


===unsigned===
|-
[[Template:Unsigned:ru]] is for [[Help:Etiquette|talk pages]]. It should be added at the ends of unsigned comments.
| [[Template:Tl2]] stands for '''T'''emplate '''L'''ink (2 as it is a replacement for an older template). It creates a link to a template surrounded by &#123;&#123; &#125;&#125;. It also accepts parameters that act like parameters for the template that is linked to.
<pre>{{unsigned:ru|JeffLane}}</pre>
| {{tlc|tl2|note|Example}}<br>{{tl2|note|Example}}
Result: {{unsigned:ru|JeffLane}}
|-
| [[Template:Tlc]] does the same but not creating a link, which is useful when trying to display template examples (like this entire page!).
| {{tlc|tlc|note|Example}}<br>{{tlc|note|Example}}
|-
| [[Template:Toc-right]] shifts the [[Help:Table of Contents|table of contents]] over to the right side of a page.
| For an example, see [[Half-Life 2 map reference]].


===update===
|-
[[Template:Update:ru]] marks outdated pages.
| [[Template:Unsigned]] is for [[Help:Etiquette|talk pages]]. It should be added at the ends of unsigned comments.
<pre>{{update:ru}}</pre>
| {{tlc|unsigned|JeffLane}}<br>{{unsigned|JeffLane}}
Result:
|}
{{messagebox
|text = This article needs to be '''updated''' to include current information regarding the subject.
|image = [[File:broom_icon.png|40px]]
}}


===warning===
==Специальные метки==
[[Template:Warning:ru]] marks things that readers should take caution of when doing something.
<pre>{{warning:ru|This tool has been known to corrupt files. Try an alternative listed below.}}</pre>
Result: {{warning:ru|This tool has been known to corrupt files. Try an alternative listed below.}}
 
===why===
[[Template:Why]] asks the question ''why?''
<pre>This shader has been deprecated.{{why}}</pre>
Result: This shader has been deprecated.{{why}}
 
===wip===
[[Template:Wip:ru]] marks pages that are in the middle of major edits. The adder requests that other users do not edit in the meantime.
<pre>{{WIP:ru|~~~}}</pre>
Result:
{{messagebox
|text =
'''This article is actively undergoing a [[Wikipedia:Wikipedia:Edit_lock|major edit]].'''<br /> As a courtesy, please do not edit this article while this message is displayed. If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce [[Wikipedia:Help:Edit_conflict|edit conflicts]]; please remove it between editing sessions to allow others to edit the page.
 
{{ #if: [[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) | The user who added this notice, should you wish to contact them, is: [[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) | The person who added this notice will be listed in its [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=history}} edit history] should you wish to contact them. }}
|image = [[File:Under construction.png|55px]]
|bdcolor = #FF7700
 
}}
 
==Magic words==
Magic words are special character strings that are kind of like templates. To apply one, simply type it on the page.
Magic words are special character strings that are kind of like templates. To apply one, simply type it on the page.


Line 418: Line 371:
===<code><nowiki>__HIDDENCAT__</nowiki></code>===
===<code><nowiki>__HIDDENCAT__</nowiki></code>===
Marks a [[Help:Categories|category]] as hidden. To make the website show hidden categories for you, check the '''Show hidden categories''' box in [[Special:Preferences#mw-prefsection-rendering|Special:Preferences]].
Marks a [[Help:Categories|category]] as hidden. To make the website show hidden categories for you, check the '''Show hidden categories''' box in [[Special:Preferences#mw-prefsection-rendering|Special:Preferences]].
===<code><nowiki>__NOINDEX__</nowiki></code>===
Tells webcrawlers not to index pages, so they don't appear in search results. Also adds the page to [[:Category:Noindexed pages]]. [[w:Wikipedia:Controlling_search_engine_indexing#Indexing_of_articles_("mainspace")|It has no effect on articles]] (in practice, because there are almost no patrolled edits on this wiki), but always effects other namespaces (such as templates, user pages, talk pages, etc.)


===<code><nowiki>{{DISPLAYTITLE:title}}</nowiki></code>===
===<code><nowiki>{{DISPLAYTITLE:title}}</nowiki></code>===
Changes the title of a page at the top bar ''only''.
Changes the title of a page at the top bar ''only''.


==See Also==
==Смотри также==
*[[Special:ExpandTemplates]] - Shows completely expanded versions of templates, including substituted wikitext code and automatic substitution for any nested templates.
*[[Special:ExpandTemplates]] - Shows completely expanded versions of templates, including substituted wikitext code and automatic substitution for any nested templates.
*[[Special:MostTranscludedPages]] - Lists templates most frequently used on pages. This doesn't show ''just'' templates actually; any page can be transcluded.
*[[Special:MostTranscludedPages]] - Lists templates most frequently used on pages. This doesn't show ''just'' templates actually; any page can be transcluded.

Revision as of 05:22, 15 June 2024

English (en)Русский (ru)中文 (zh)Translate (Translate)
Info content.png
This translated page needs to be updated.
You can help by updating the translation.
Also, please make sure the article complies with the alternate languages guide.(en)
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.


Info content.png
This page needs to be translated.
This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)

Шаблон это страница, созданная для использования на других страницах. Шаблоны обычно содержат повторяющуюся информацию, которая может потребоваться для отображения в большем количестве статей или страниц. Они обычно используются для создания стандартных сообщений, предупреждений или уведомлений, информационных блоков, навигационных панелей и тому подобных целей.

Шаблоны позволяют создавать страницы намного быстрее иудобнее. Шаблоны очень часто используются на страницах, поэтому лучше узнать о них заранее. Когда платформа Wiki определяет шаблон при обработке страницы, он автоматически заменяется соотвествующим содержимым. Что там появится, зависит от пользователей.

Как использовать шаблон

Прежде чем шаблон может быть добавлен куда-либо, сначала его содержимое должно быть определено на его собственной странице. Страницы шаблонов должны начинаться с префикса Template:.

Шаблоны имеют некоторые ограниченные возможности программирования, что даёт им много возможностей. Подробнее о них мы поговорим позже.

Чтобы добавить шаблон на страницу (это называется транскрипция), просто введите {{, имя шаблона, а затем }}. Если вы хотите добавить какие-либо параметры, поместите | между именем шаблона и }} и определите параметры там. Все параметры, которые вы определите, должны быть разделены ещё одним символом |.

Note.pngПримечание:Любая страница может быть исключена другой страницей. Ниже приведено исключение главной страницы:
Note.pngПримечание:Any page can be transcluded by another one actually. A transclusion of the Main Page can be done using {{:Main Page}}, but we don't do this here because it would add all of the headlines of the Main Page to the table of contents of this page.

Примеры

Вот шаблон, в котором мы не определяем никаких параметров, вы просто вставляете его прямо в шаблон.

{{restart}}

Результат: Для применения изменений требуется перезапуск.

Если Вы посетите страницу этого шаблона, то увидите, что в нём всего пять слов.


Шаблон command - это шаблон, который может принимать до двух безымянных параметров.

{{Command|sv_cheats|1}}

Результат: sv_cheats 1

Безымянные параметры должны быть определены в определённом порядке.

Подстановка (для опытных)

Instead of transcluding a template, one can choose to substitute it. Substitution will replace a template with the contents of the template directly onto the page. To substitute a template, transclude it like you normally would, then add subst: between {{ and the template's name. After that, click the save button and the wikitext will automatically be added. Do not substitute carelessly, because the substituted wikitext will not be updated when the template is. See Wikipedia:Help:Substitution for more information.

{{subst:delete|This is a bad page.}}

When the page is saved, that text will be replaced with this:

{{Delete-meta|{{#if: This is a bad page. | This is a bad page. }} }}[[Category:Candidates for speedy deletion]]

Note the automatic forwarding of parameters. When substituting, the page should not appear any differently than it would if transcluded. The only difference is in the page code.

Сошдание шаблонов

Making a template like Template:Restart is rather easy - just type the text you want, and save it. What about ones with parameters?

Tip.pngСовет:When making templates, you may want to space out your code to make it easier to read, but watch out for unintentional whitespace. HTML comments (<!-- -->) can also be useful.

Безымянные параметры

To add an unnamed parameter, simply put {{{1}}} where you want it to be.

Here's part of the code for Template:Tip:

Tip:{{{1}}}

If you've seen this template before you know that it has its own special look, but this is all we will look at for now. All the user has to do when transcluding this is enter the text they want:

{{tip|Do not carve without vertex editing afterward.}}

Result:

Tip.pngСовет:Do not carve without vertex editing afterward.

If you want to add more than one unnamed parameter, simply change the number. Here's the old (condensed) code for Template:Distinguish:

:''Not to be confused with [[:{{{1}}}]]{{#if:{{{2|}}} |{{#if:{{{3|}}} |, [[:{{{2}}}]]| or [[:{{{2}}}]].}}|.}}{{#if:{{{3|}}} |{{#if:{{{4|}}} |, [[:{{{3}}}]]|, or [[:{{{3}}}]].}}}}{{#if:{{{4|}}} |, or [[:{{{4}}}]].}}''

This template has some things we haven't talked about yet, but you can still see that there's four unnamed parameters used: {{{1}}}, {{{2}}}, {{{3}}}, and {{{4}}}.

All the user has to do when transcluding is this:

{{distinguish|Combine|Civil Protection|Overwatch}}

Result:

Не следует путать с Combine, Civil Protection или Overwatch.

Именованные параметры

Usually you would want to have named parameters affect anything only if they are defined when being transcluded. We'll talk about conditions later. For now, let's look at Template:IO, which has many named parameters. In this template, {{{param}}} marks a place to add wikitext that's defined by |param=texthere when transcluding.

With named parameter:

{{IO|SetString|Updates the string.|param=string}}

Result:

SetString <строка(en)>
Updates the string.


Without named parameter:

{{IO|SetString|Updates the string.}}

Result:

SetString
Updates the string.

Значение по умолчанию

To make a parameter have a value by default, add a | to the right of the parameter name, and then define the value. Named and unnamed parameters can use this.

{{{1|3000}}}

This would make the value for 1 3000.

{{{value|}}}

This returns nothing. Without the |, it would literally return "{{{value}}}" as text, if it hasn't already been defined at some other point.

Функции анализатора

#if: checks if a string or parameter has anything inside it.

{{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }}

Result: Sleep mode activated... (The parameter {{{target|}}} returns null because you (probably) are not viewing this page through a transclusion, so it's never had a chance to be defined.)

{{#if: Something is there! | Target aqcuired | Sleep mode activated... }}

Result: Target aqcuired


#ifeq: checks for equality between two strings. It can be used with parameters as well.

{{#ifeq: {{{target|}}} | friend | Friend... | Go away! }}

Result: Go away!

{{#ifeq: friend | friend | Friend... | Go away! }}

Result: Friend...


#expr: solves math problems.

{{#expr: 2 + 2}}

Result: 4

See m:Help:Calculation for all it's abilities.


#ifexpr: tells if a math expression is correct.

{{#ifexpr: 6 + 3 = 9 | Right | Wrong }}

Result: Right

{{#ifexpr: 6 + 3 = 23 | Right | Wrong }}

Result: Wrong

Документация

Please give a description of what your template is, and maybe examples. To keep this describing text from appearing on pages, there are 3 different HTML tags you can use.

noinclude keeps wikitext inside it from appearing on the destination page, while keeping it on the source page.

onlyinclude makes only wikitext inside it appear on destination pages. Text not inside these will still appear on the template's page.

includeonly wikitext inside this will not appear on the template page. It has no effect on the destination page however.

They can sound very confusing at first. If you're confused on how to use them, check the source code for a template, because almost all use them for one purpose or another.

Шаблоны не обновляются

If you've recently edited a template and the changes are not applying on pages it's been transcluded to, add ?action=purge at the end of the URL for those pages. This will tell the server to update the page's HTML immediately. You can achieve the same effect by editing a page and saving it without making any changes.

Ярлыки шаблонов

Some templates may have template shortcuts, which are redirects that are abbreviated or otherwise different forms of their target templates. Template shortcuts can be transcluded just like their target templates.

Переводы

Templates should include translations so that people who natively speak other languages can more easily understand the contents of the template. There are two ways this can be accomplished.

Первый метод: {{Autolang}}

This is usually used on smaller templates with little text. This template automatically detects the language of the UI and gives the appropriate translation, if available. This is usually sufficient, however on larger templates it is usually recommended to use Method Two.

Второй метод: Подстраницы строк

Larger templates (e.g. {{Software page}}) tend to have large amounts of text, and having them all on one page makes it pointlessly cluttered and very hard to edit. To solve this, almost all text on these templates go on a Strings Subpage (e.g. {{Software page/strings}}), which, when a specific string is specified, will present the appropriately translated text. This helps make not only text editing but translating much easier because editors don't have to shift through lots of code to find a small bit of text they want to edit/translate. This can he very complicated for smaller templates however, so it is usually reserved for larger templates.

Tip.pngСовет:You may see some templates still using the old suffix translation method. Keep in mind that this is no longer the preferred method and, if you know how, should be updated to use the current methods.

Полезные шаблоны

All templates in green text are that color so that they stand out against the greyscale tones of most pages. Most templates with that color also automatically add pages they are transcluded on into Category:TODO.

Именные шаблоны

All games have templates named by their shortcut that can deliver their associated icon and/or a link to their page. See Category:Game icons for a full list of game shortcuts. All of them accept the same set of parameters that are described on every template page. The following table should give examples and also give ideas on when to use them.

Wikitext Пример Описание Ранее используемый шаблон/Альтернатива
{{<shortcut>}} {{hl2}} Half-Life 2 Displays the game's icon which links to its game's page and shows the game's name as a hover text. Putting this at the beginning (or end) of a word or line is the shortest and most common way of clarifying that something applies only to a specific game, but there are more ways.
{{<shortcut>|2}} {{hl2|2}} Half-Life 2 Half-Life 2 Displays the game's icon followed by its name which both link to the game's page. Useful in sentences when the icon alone is too little but the next style is too much. {{game link}} [Obsolete-notext.png Устарело]
{{<shortcut>|4}} {{hl2|4}} Half-Life 2 Half-Life 2 Does the same but using colorful text which grabs more attention, so don't overuse this on a page. Especially if you name the same game multiple times in a text, you definitely don't need a long, colorful link every time, let alone a link. {{game name}} [Obsolete-notext.png Устарело]
{{<shortcut>|in}} {{hl2|in}} (в Half-Life 2) Can be used to indicate that something applies to a specific game. Useful at the end of a line or key word; The same applies to the following variants. {{in}}
{{<shortcut>|since}} {{portal2|since}} (Во всех играх начиная с Portal 2) Can be used to quickly note features that were added in a game and are available in all Source games afterwards. {{since}}
{{<shortcut>|only}} {{csgo|only}} (только в Counter-Strike: Global Offensive) Indicates features that are exclusive to a specific game. {{only}}
{{<shortcut>|also}} {{as|since}} {{gmod|also}} (Во всех играх начиная с Alien Swarm) (также в Garry's Mod) Notes that earlier game also has a feature, usually backported from newer engine branches. These should be used with in conjunction with another game notice template. {{also}}
{{<shortcut>|removed}} {{l4d|removed}} (удалено начиная с Left 4 Dead) Indicates that a feature was removed in a game and all later engine branches. {{removed}}
{{<shortcut>|not}} {{czds|not}} (нет в Condition Zero удалённые сцены) Indicates that a feature might be in other games but not in a specific one. {{not}}

Шаблоны внутренних заметок

The following are some of the inline note templates.

Описание Wikitext и Результат
Template:Bug notifies readers of a bug. {{bug|The amount is double what it should be. Be careful!}}
Icon-Bug.pngБаг:The amount is double what it should be. Be careful!  [нужно проверить в ?]
Template:Clarify marks things that should be clarified. PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}
PAS is a kind of bounding-box for Player or NPC AI sound detection.[Уточнить]
Template:Confirm marks something that needs to be confirmed. It's green color is meant to stand out. {{confirm|Always goes to the left.}}
Подтвердить:Always goes to the left.
Always goes to the left.{{confirm}}
Always goes to the left.[подтвердить]
Template:Distinguish lets you notify users about pages that share similar names or may be confused for something else. {{distinguish|"Follow Freeman!"|desc1=The HL2 chapter}}
Не следует путать с "Follow Freeman!" (The HL2 chapter).
Template:How asks the question how? Players can get past these.{{how}}
Players can get past these.[Как?]
Template:Idea is a nifty way to suggest ideas. {{idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}
Tip.pngИдея:Reward players for being clever and creative, instead of forcing things to be only one way.
Template:Main notes that there is a more detailed article about a certain topic. {{main|Soundscripts}}
Основная статья:  Soundscripts
Template:Note is for making notes stand out more. {{note|This will spawn at the map origin if you do not specify the position.}}
Note.pngПримечание:This will spawn at the map origin if you do not specify the position.
Template:Question denotes a question {{question|Does this work in newer engine branches?}}
Icon-silk-question.png Вопрос: Does this work in newer engine branches?
Template:Suggestion is for suggesting something {{suggestion|Levels should be optimized for peak performance.}}
Icon-silk-comment.pngSuggestion: Levels should be optimized for peak performance.
Template:Tip marks text as a tip to readers. {{tip|This is a much less tricky process when using the vertex edit tool as well.}}
Tip.pngСовет:This is a much less tricky process when using the vertex edit tool as well.
Template:Todo marks things that need to be done. It's green color is meant to stand out. {{todo|Find where this is in the game files.}}
To do: Find where this is in the game files.
Template:Warning marks things that readers should take caution of when doing something. {{warning|This tool has been known to corrupt files. Try an alternative listed below.}}
Warning.pngПредупреждение:This tool has been known to corrupt files. Try an alternative listed below.
Template:Workaround informs readers of a workaround {{workaround|This should be automated with logic instead.}}
PlacementTip.pngОбходной приём:This should be automated with logic instead.
Template:Why asks the question why? This shader has been deprecated.{{why}}
This shader has been deprecated.[Почему?]

Шаблоны уведомлений

The following is a list of some notice templates.

Описание Wikitext и Результат
{{Cleanup}} marks a page that needs to be fixed up, preferably by someone knowledgeable. The text message is optional. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. {{cleanup|The last section needs to be clarified.}}
Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality because:
The last section needs to be clarified
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.
{{Delete}} marks a page that should be deleted. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. When putting this on a page, you should also list the reason on that page's talk page, for any future readers that may want to know the purpose of the deletion. {{delete}}
Warning icon.png
This help page has been marked as a candidate for speedy deletion.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
{{Merge}} is a notice that notifies editors that it's been suggested for two or more pages to be combined into one. All merges should be discussed before being done. {{merge|HDR}}
Merge-arrows.png
It has been suggested that this article or section be merged with HDR. (Discuss)
{{Split-apart}} marks pages that should be split into multiple pages. All splits should be discussed before being done. {{split-apart}}

Split-arrows.png Разделить

Было предложено разделить эту статью или раздел на несколько статей. (Обсуждение)

{{Moveto}} marks pages that should be moved to a different title, or sections of an article that should be moved to either another article or to their own new one. All moves should be discussed before being done. {{Moveto}}
Merge-arrow.png
Было предложено перенести эту статью или раздел в [[{{{1}}}]]. (Обсуждение)
{{screenshot}} marks pages that should have more images on them. It allows for an optional text message to clarify what needs images. {{screenshot}}
Nuvola apps ksnapshot.png
This article or section needs a screenshot to help visually convey the subject.
You can upload screenshots at Special:Upload. For help, see Help:Images.


{{Obsolete}} marks things that should no longer be used. Accepts three parameters, entity, tool, and shader. {{obsolete|entity=1}}
{{Spammer}} marks users that should be banned for spamming. For suspicious but not bannable behavior, there is also Template:Minor Spammer.
Icon-Bug.pngБаг:This template's formatting may look weird sometimes. It's intended to be the only thing on a page.  [нужно проверить в ?]
{{spammer}}
Spammer.jpg
Note.pngПримечание:This user is a spammer, vandal or other problem poster and should be considered for a ban

{{Banned user}} marks users that have been banned (usually by Valve employees) for spamming, vandalizing pages, edit warring or trolling along with many other reasons. {{Banned user}}
Icon-crystalclear-flag.png
This user has been banned for an unspecified reason, such as Wikipedia icon spamming, Wikipedia icon vandalism, Wikipedia icon copyright violations, Wikipedia icon sockpuppetry, Wikipedia icon edit warring, trolling or Wikipedia icon harassment, and/or violating the Valve Developer Community's Terms of Use along with other misbehavior.
{{Stub}} marks pages that are very small. See Help:Stubs for info on using. {{stub}}

Неполная

This article or section is a stub. You can help by expanding it.

{{Translate}} marks pages where translation is needed and adds the page to a category. {{Translate}}
Info content.png
This page needs to be translated.
This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)
{{Update}} marks outdated pages. {{update}}
Broom icon.png
This article or section needs to be updated to include current information regarding the subject.
Remember to check for any notes left by the tagger at this article's talk page.
{{Wip}} marks pages that are in the middle of major edits. The adder requests that other users do not edit in the meantime. {{Wip}}
Under construction.png
This Help page is actively undergoing a major edit.
As a courtesy, please do not edit this Help while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.

The person who added this notice will be listed in its edit history should you wish to contact them.


{{Draft}} marks pages that are currently being worked on. {{draft}}
Icon-under construction-blue.png
This is a draft help page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.


{{Rewrite}} marks pages that are being rewritten, usually with a wip version on another page. {{Rewrite|Help:Templates}}
Icon-edit.png
This help is currently being rewritten.
The rewrite can be found at Help:Templates. You can discuss the changes here.

Прочие шаблоны

These templates have the purpose of helping the editor.

Описание Wikitext and Result
Template:= is a template that only returns an equal sign. The character is sometimes needed because multiple wiki features make use of it. Especially, the equals sign is a special character in template calls, so if an equals sign should be passed as a parameter value, then {{=}} is needed for "escaping". For the same purpose, there is also Template:! for a pipe, Template:((( for curly brackets and many more, see Category:Templates for within templates. {{=}}
=
{{note|If x {{=}} 0, you lose.}}
Note.pngПримечание:If x = 0, you lose.
Template:Clr clears the vertical space to the left and right of floating tables, floating images etc. To clear only one side, use {{clr|left}} or {{clr|right}}. This is commonly used before headlines to push them down so that they don't appear next to an image. In the example on the right, one could also use {{clr|left}} for the same effect. [[File:Skull and crossbones.png|50px|left]] This text is next to the image.{{clr}}This text is below the image.

Skull and crossbones.png
This text is next to the image.
This text is below the image.
Template:Ent is a really small template for making text that's both code and a link. {{ent|noclip}}
noclip
Template:Expand or Template:ExpandBox allows you to hide stuff inside a box that can be shrunk down so that it doesn't make pages as long. class="mw-collapsible mw-collapsed" style="background:rgba(0,0,0,0.05) ;float:no;margin-bottom:1em;margin-left:0;padding-right:0.5em;border:1px solid rgba(255,255,255,0.1); border-left:solid 1px #8bb9e0; padding-left:1em;"

|- | {{ExpandBox|{{KV BaseEntity|noscroll=1}}}}


|- | Template:MultiPage is used for translations, which replaced the deprecated {{Lang}} template, which stands for language. This page itself uses the MultiPage template, using the wikitext {{MultiPage}}, and with the {{Language subpage}} template added to the language subpages (for example, it is located in Help:Templates/en for English language, containing everything else with the {{Language subpage}} template on top).

The {{MultiPage}}, and it's predecessor, {{Lang}} template creates flags at the top right corner of a page such as English (en) Русский (ru) 中文 (zh) and thus must be the first template to be transcluded to be in the right position.

Every page can and should use this template as it lets the reader know of the existence of (correctly titled) language pages of the current page and clicking on the flags links to them. Read more on Template:MultiPage. | {{lang|Help:Templates}}
The result is at the very top of this page.

|- | Template:Param displays the values like parameters in the way that they are used in templates. Useful for template documentations. | {{param|color|#fff}}
{{{color|#FFF}}}

|- | Template:Shortcut displays a small box noting (abbreviated) redirects to a page.

| {{shortcut|VDC:AL}}

|- | Template:Tl2 stands for Template Link (2 as it is a replacement for an older template). It creates a link to a template surrounded by {{ }}. It also accepts parameters that act like parameters for the template that is linked to. | {{tl2|note|Example}}
{{note|Example}} |- | Template:Tlc does the same but not creating a link, which is useful when trying to display template examples (like this entire page!). | {{tlc|note|Example}}
{{note|Example}} |- | Template:Toc-right shifts the table of contents over to the right side of a page. | For an example, see Half-Life 2 map reference.

|- | Template:Unsigned is for talk pages. It should be added at the ends of unsigned comments. | {{unsigned|JeffLane}}
Неподписанный коментарий добавлен JeffLane (разговорвклад) |}

Специальные метки

Magic words are special character strings that are kind of like templates. To apply one, simply type it on the page.

__TOC__

Forces the table of contents to be placed at this spot.

__FORCETOC__

Forces the table of contents to be placed at its normal spot. (Only useful on pages that don't have enough sections to automatically display a TOC.)

__NOTOC__

Hides the table of contents.

__HIDDENCAT__

Marks a category as hidden. To make the website show hidden categories for you, check the Show hidden categories box in Special:Preferences.

__NOINDEX__

Tells webcrawlers not to index pages, so they don't appear in search results. Also adds the page to Category:Noindexed pages. It has no effect on articles (in practice, because there are almost no patrolled edits on this wiki), but always effects other namespaces (such as templates, user pages, talk pages, etc.)

{{DISPLAYTITLE:title}}

Changes the title of a page at the top bar only.

Смотри также