Помощь:Шаблоны

From Valve Developer Community
(Redirected from Help:Templates/ru)
Jump to: navigation, search
English (en)Русский (ru)中文 (zh)
Edit-copy.png
This is a help page
That means that this article contains information intended to advise or aid on the functions of the wiki, on how to use the wiki, or on general recommendations for users of the wiki.


Info content.png
Эта страница нуждается в переводе.

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


Дополнительно, воспользуйтесь русским словарём переводчика.

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

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

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

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

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

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

Note.pngПримечание:Любая страница может быть интегрирована в другую страницу. Интеграцию главной страницы (en) можно выполнить используя {{:Main Page}}, но мы не делаем этого здесь, потому что это добавило бы все заголовки главной страницы в оглавление этой страницы.

Примеры

Вот шаблон, в котором мы не определено никаких параметров. При просмотре страницы выражение {{restart}} (или {{Restart}}) будет заменено содержимым шаблона Template:Restart. Если Вы зайдете на страницу этого шаблона, то увидите, что в нём всего пять слов.

{{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.}}

Результат:

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 {{L|:{{{1}}}}}{{#if:{{{2|}}} |{{#if:{{{3|}}} |, {{L|:{{{2}}}}}| or {{L|:{{{2}}}}}.}}|.}}{{#if:{{{3|}}} |{{#if:{{{4|}}} |, {{L|:{{{3}}}}}|, or {{L|:{{{3}}}}}.}}}}{{#if:{{{4|}}} |, or {{L|:{{{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}}

Результат:

Not to be confused with 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}}

Результат:

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


Without named parameter:

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

Результат:

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: проверяет, является ли строка пустой или нет. Синтаксис следующий: {{#if: <строка> | <то> | <иначе> }}. Это выражение преобразуется в <то>, если <строка> не является пустой строкой, в противном случае - в <иначе>. Значение <else> может быть опущено, и в этом случае по умолчанию используется пустая строка, то же самое относится и к следующим <else>.

{{#if:   | Not empty | Empty }} → Empty
{{#if: X | Not empty | Empty }} → Not empty
{{#if:   | Not empty }}
{{#if: X | Not empty }} → Not empty
{{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }} → Sleep mode activated...
{{#if: Something is there! | Target aqcuired | Sleep mode activated... }} → Target aqcuired
Note.pngПримечание:Выражение {{{target|}}} возвращает пустую строку, потому что Вы (вероятно) не просматриваете эту страницу через интеграцию, поэтому оно не может быть определено, соотвественно возвращает значение по умолчанию, являющееся пустой строкой.

#ifeq:проверяет равенство двух строк. Синтаксис следующий: {{#ifeq: <строка1> | <строка2> | <равны> | <иначе> }}. Это значение равно <равны>, если две (обрезанные) строки полностью равны, в противном случае - <иначе>.

{{#ifeq: X | X | Equal | Not equal }} → Equal
{{#ifeq: X | Y | Equal | Not equal }} → Not equal
{{#ifeq: {{{target|}}} | friend | Friend... | Go away! }} → Go away!
{{#ifeq: friend | friend | Friend... | Go away! }} → Friend...

#switch: проверяет соотвествие входной строки с несколькими строками. Синтаксис следующий: {{#switch: <input> | <string1> = <value1> | <string2> = <value2> | ... | #default = <default> }}. Этот выражение вычисляет значение <ValueX> соответствующее первому <stringX>, которое равно <input>. Если за этим <stringX> не следует знак равенства, и нет значения <ValueX>, то будет использоваться значение <valueY> следующего <stringY> у которого есть знак равенства. Если равенство не найдено, возвращается значение <default>, которое по умолчанию является пустой строкой, если оно не указано.

#expr: решает математические выражения. Смотрите все возможности Help:Calculation (en). При возникновении ошибки возвращается строка внутри элемента <strong class="error">.

{{#expr: 2 + 2}} → 4
{{#expr: cos(pi/3)^2}} → 0.25
{{#expr: 0 and 1 or 1}} → 1
{{#expr: 1 + }}Expression error: Missing operand for +.
{{#ifeq: {{#expr: 1 + }} | 1 | True | False}} → False

#ifexpr: проверяет, является ли математическое выражение истинным или ложным и возвращает соотвествующее значение.

{{#ifexpr: 6 + 3 =  9 | Right | Wrong }} → Right
{{#ifexpr: 6 + 3 = 63 | Right | Wrong }} → Wrong
Warning.pngПредупреждение:When passing parameters to the expression, pay attention not to get errors if the parameter is empty. For example, if an integer parameter should behave like 0 if it is left empty, add a decimal point because . is converted to the same zero as 0..

For example, use {{{hl2|0}}}. instead of {{{hl2|0}}} because the latter may fail if hl2= is specified:

{{#ifexpr: 1 or . | True | False}} → True
{{#ifexpr: 1 or   | True | False}}Expression error: Missing operand for or.

lc: и uc: преобразуют строку в строчные или прописные буквы соотвественно. Обратите внимание, что они не имеют знака # в отличие от #if: и других. Также существуют lcfirst: и ucfirst:, которые аналогично преобразуют только первый символ строки.

{{lc:Case Sensitivity}} → case sensitivity
{{uc:Case Sensitivity}} → CASE SENSITIVITY
{{lcfirst:Case Sensitivity}} → case Sensitivity
См. также: Help:Extension:ParserFunctions (en)

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

Пожалуйста, добавляйте описание вашего шаблона, и особенно приведите примеры его использования. Чтобы текст описания не появлялся на страницах, использующих шаблон, или чтобы сама страница шаблона выглядела аккуратно, Вы можете использовать три следующих HTML-метки

  • <noinclude>...</noinclude> предотвращает перенос wiki-текста на другие страницы. Он будет отображаться только на странице шаблона.
  • <onlyinclude>...</onlyinclude> предписывает отображать на использующих страницах только wiki-текст шаблона. Все остальное не будет использовано, но все равно будет отображаться на странице шаблона.
  • <includeonly>...</includeonly> предотвращает появление внутреннего wiki-текста на странице шаблона. Это никак не влияет на использующую шаблон страницу.

So you can either surround everything that should be transcluded with <onlyinclude> or surround everything else with <noinclude>. In addition, you can use <includeonly> to hide the template text on the template page. The tags 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 the documentation cannot be kept short, then it is a good idea to move all explanations and/or examples to an own page. By convention, the documentation page of a template should be its subpage /doc. For instance, Template:Note has its documentation page Template:Note/doc. When created, the documentation is transcluded to the template page using just the expression {{doc}} which of course must be excluded using the above tags.

Sometimes, templates are used identically. As you might know, Template:Tip and Template:Note both use their one parameter in exactly the same manner, so there is no need for another page with an identical documentation for Tip. Tip can use the same documentation as Note using the expression {{documentation|Template:Note/doc}}; The only magic behind this is that Template:Note/doc uses the expression {{ROOTPAGENAME}} instead of Note for its examples so that the examples adapt to the page that they are displayed on. If Template:Note/doc wasn't made for this, this wouldn't work out. Other "generic docs" like this that are in use are Template:Hl2 and Template:Yes.

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

Если Вы недавно редактировали шаблон, но изменения не применяются к страницам, на которых он используется, добавьте ?action=purge в конце строки адреса этих страниц. Это позволит серверу немедленно обновить HTML-код страницы. Вы можете добиться того же эффекта, перейдя в редактирование страницы и сохранив её без каких-либо изменений. Или воспользуйтесь специальным сообщением Purge base's cache, которое будет отображаться в верхней части страницы шаблона после записи изменений его страницы.

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

Некоторые шаблоны имеют ярлыки перенаправления, которые являются сокращениями их названия или иным образом отличаются от исходных шаблонов. Ярлыки шаблонов можно использовать точно так же, как и их исходные шаблоны.

Переводы

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 .

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

Каждая игра имеет собственный ярлык, именованный по её шаблону, который может содержать соответствующую иконку и/или ссылку на их страницу. Полный список ярлыков игр смотрите в разделе Category:Game icons (en). Все они имеют одинаковый набор параметров, которые описаны на каждой странице шаблона. В следующей таблице приведены примеры, а также идеи о том, когда их следует использовать.

Wiki-текст Пример Описание Ранее используемый шаблон/Альтернатива
{{<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}}

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

Ниже приведены некоторые шаблоны внутренних заметок .

Описание Wiki-текст и Результат
Template: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 отмечает моменты, которые требуют пояснения. 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 обозначает требование о подтверждении. Для контраста используется зелёный цвет. {{confirm|Always goes to the left.}}
Подтвердить:Always goes to the left.
Always goes to the left.{{confirm}}
Always goes to the left.[подтвердить]
Template:Distinguish позволяет уведомлять пользователей о страницах, которые имеют похожие названия или могут быть перепутаны с чем-то другим. {{distinguish|"Follow Freeman!"|desc1=The HL2 chapter}}
Not to be confused with "Follow Freeman!" (The HL2 chapter).
Template:How добавляет к пункту вопрос Как? Players can get past these.{{how}}
Players can get past these.[Как?]
Template:Idea это отличный способ предлагать идеи. {{idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}
Идея: Reward players for being clever and creative, instead of forcing things to be only one way.
Template:Main обращает внимание, что есть более подробная статья по указанной теме. {{main|Soundscripts}}
Основная статья:  Soundscripts
Template:Note используется для выделения заметок. {{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 используется для обозначения вопроса. {{question|Does this work in newer engine branches?}}
Icon-silk-question.png Вопрос: Does this work in newer engine branches?
Template:Suggestion используется для описания предлагаемых действий. {{suggestion|Levels should be optimized for peak performance.}}
Icon-silk-comment.pngSuggestion: Levels should be optimized for peak performance.
Template:Tip помечает текст как подсказку для читателей. {{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 отмечает моменты, которые нужно сделать. Для контраста используется зелёный цвет. {{todo|Find where this is in the game files.}}
Blank image.pngНужно сделать: Find where this is in the game files.
Template:Warning отмечает моменты, на которые читателям следует обратить внимание. {{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 информирует читателей об ином способе выполнения. {{workaround|This should be automated with logic instead.}}
PlacementTip.pngОбходной приём: This should be automated with logic instead.
Template:Why добавляет к пункту вопрос Почему? This shader has been deprecated.{{why}}
This shader has been deprecated.[Why?]

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

Ниже приведены некоторые шаблоны уведомлений .

Описание Wiki-текст и Результат
{{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.}}
Icon-broom.png
Эта статья или раздел требует доработки, чтобы соответствовать более высокому стандарту качества потому что:
The last section needs to be clarified
Для получения помощи, обратитесь к руководству по редактированию на VDC и процессу очистки на Wikipedia. Также не забудьте проверить наличие заметок, оставленных отмечающим на странице обсуждения этой статьи.
{{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
Страница справки помечена как кандидат на удаление.
Если у Вас имеются возражения, пожалуйста обсудите их здесьЕсли эта страница не соответствует критериям для быстрого удаления, пожалуйста, удалите это уведомление, но не удаляйте его со страниц, которые Вы создали самостоятельно
Администраторы - Не забудьте проверить, есть ли здесь какие-либо ссылки, и историю страницы (последние правки) перед удалением.
{{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
Было предложено объединить эту статью или раздел с [[HDR (en)]]. (Обсуждение)
{{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
Эту статью или раздел необходимо дополнить снимком экрана, который поможет с наглядным описанием темы.
Можете загрузить их на странице Загрузить файл. Для справки смотрите Помощь:Изображения.


{{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 (en)

{{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
Этот пользователь был заблокирован по неуточнённой причине, такой как:
Wikipedia icon публикация спама, Wikipedia icon вандализм, Wikipedia icon нарушение авторских прав, Wikipedia icon дублирования учётных записей, Wikipedia icon конкурирующее редактирование, провокации или Wikipedia icon преследование, и/или нарушение условий использования Сообщества VDC, и другие деструктивные действия.
{{Stub}} marks pages that are very small. See Help:Stubs for info on using. {{stub}}

Неполная

Эта статья(раздел) является наброском. Вы можете помочь, дополнив её.

{{Translate}} marks pages where translation is needed and adds the page to a category. {{Translate}}
Info content.png
Эта страница нуждается в переводе.

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


Дополнительно, воспользуйтесь русским словарём переводчика.
{{Update}} marks outdated pages. {{update}}
Icon-broom.png
Эта статья нуждается в обновлении, чтобы включить актуальную информацию по теме.
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
Эта Help страница претерпевает крупные изменения.
В порядке вежливости не редактируйте страницу Help, пока это сообщение не будет убрано. Если страница не редактировалась уже несколько часов или дней, удалите этот шаблон.
Данное сообщение позволяет предотвратить конфликт редактирований; удаляйте сообщение между сеансами редактирования, чтобы передать очередь редактирования другим участникам.

Участник, добавивший сообщение, есть в истории изменений, и вы можете связаться с ним.


{{Draft}} marks pages that are currently being worked on. {{draft}}
Under construction icon-blue.png
Это черновик страницы help. Работа над ним продолжается, и любой желающий может его редактировать.
Не забудьте проверить замечания, оставленные автором на странице обсуждения этой статьи.


{{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.

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

Эти шаблоны предназначены для помощи редакторам.

Описание Wiki-текст и Результат
Template:= - это шаблон, который возвращает только знак равенства. Иногда этот символ необходим, поскольку он используется во многих wiki-функциях. В частности, знак равенства является специальным символом в вызовах шаблонов, поэтому, если знак равенства должен быть передан в качестве значения параметра, то для "экранирования" необходимо использовать {{=}}. Для этой же цели существует шаблон Template:! для восклицетельного знака,Template:((( для фигурных скобок и многие другие смотрите в разделе Category:Templates for within templates (en). {{=}}
=
{{note|Если x {{=}} 0, Вы проиграли.}}
Note.pngПримечание:Если x = 0, Вы проиграли.
Template:Clr очищает вертикальное пространство слева и справа от плавающих таблиц, изображений и т.д. Чтобы очистить только одну сторону, используйте {{clr|left}} или {{clr|right}}. Обычно это используется перед заголовками, чтобы опустить их вниз, чтобы они не отображались рядом с изображением. В примере справа можно также использовать {{clr|left}} для того же эффекта. [[File:Skull and crossbones.png|50px|left]] Этот текст находится рядом с изображением.{{clr}}Этот текст находится под изображением.

Skull and crossbones.png
Этот текст находится рядом с изображением.
Этот текст находится под изображением.
Template:Ent - это небольшой шаблон для создания текста, который одновременно является кодом и ссылкой. {{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. {{Expand|{{KV BaseEntity|noscroll=1}}}}

Base:
Name (targetname) <строка>
Название объекта по которому другие объекты могут ссылаться на этот объект.
Parent (parentname) <целевой объект>
Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (parentname [targetname],[attachment])
Tip.pngСовет:Entities transition to the next map with their parents
Tip.pngСовет:phys_constraint can be used as a workaround if parenting fails.
Origin (X Y Z) (origin) <coordinates>
Положение центра этого объекта в пространстве мира. Rotating entities typically rotate around their origin.
Note.pngПримечание:Hammer does not move the entities accordingly only in the editor.
Pitch Yaw Roll (X Y Z) (angles) <angle>
Ориентация этого объекта в пространстве мира. Тангаж (Pitch) - вращение вокруг оси Y, рысканье(yaw) - вращение вокруг оси Z, крен(roll) - вращение вокруг оси X.
Note.pngПримечание:This works on brush entities, although Hammer doesn't show the new angles.
Classname (classname) <строка> Отсутствует в FGD!
Определяет свойства объекта до его появления.
Tip.pngСовет:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
Spawnflags (spawnflags) <flags> Отсутствует в FGD!
Переключает специфические возможности объекта, конечное числовое значение определется комбинацией включенных возможностей.
Effects (effects) <flags> Отсутствует в FGD!
Набор эффектов для использования.
Entity Scripts (vscripts) <скриптлист VScript> (Во всех играх начиная с Left 4 Dead 2) (также в Team Fortress 2)
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. Scripts executed on the worldspawn entity will be placed in root scope.
Think function (thinkfunction) <строка> (Во всех играх начиная с Left 4 Dead 2) (также в Team Fortress 2)
Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. Avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <булева переменная> (Во всех играх начиная с Left 4 Dead 2) Отсутствует в FGD!
Set to Yes to lag compensate this entity. Should be used very sparingly!
Is Automatic-Aim Target (is_autoaim_target) <булева переменная> (Во всех играх начиная с Counter-Strike: Global Offensive) Отсутствует в FGD!
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.
{{ExpandBox|{{KV BaseEntity|noscroll=1}}}}


Base:
Name (targetname) <строка>
Название объекта по которому другие объекты могут ссылаться на этот объект.
Parent (parentname) <целевой объект>
Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (parentname [targetname],[attachment])
Tip.pngСовет:Entities transition to the next map with their parents
Tip.pngСовет:phys_constraint can be used as a workaround if parenting fails.
Origin (X Y Z) (origin) <coordinates>
Положение центра этого объекта в пространстве мира. Rotating entities typically rotate around their origin.
Note.pngПримечание:Hammer does not move the entities accordingly only in the editor.
Pitch Yaw Roll (X Y Z) (angles) <angle>
Ориентация этого объекта в пространстве мира. Тангаж (Pitch) - вращение вокруг оси Y, рысканье(yaw) - вращение вокруг оси Z, крен(roll) - вращение вокруг оси X.
Note.pngПримечание:This works on brush entities, although Hammer doesn't show the new angles.
Classname (classname) <строка> Отсутствует в FGD!
Определяет свойства объекта до его появления.
Tip.pngСовет:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
Spawnflags (spawnflags) <flags> Отсутствует в FGD!
Переключает специфические возможности объекта, конечное числовое значение определется комбинацией включенных возможностей.
Effects (effects) <flags> Отсутствует в FGD!
Набор эффектов для использования.
Entity Scripts (vscripts) <скриптлист VScript> (Во всех играх начиная с Left 4 Dead 2) (также в Team Fortress 2)
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. Scripts executed on the worldspawn entity will be placed in root scope.
Think function (thinkfunction) <строка> (Во всех играх начиная с Left 4 Dead 2) (также в Team Fortress 2)
Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. Avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <булева переменная> (Во всех играх начиная с Left 4 Dead 2) Отсутствует в FGD!
Set to Yes to lag compensate this entity. Should be used very sparingly!
Is Automatic-Aim Target (is_autoaim_target) <булева переменная> (Во всех играх начиная с Counter-Strike: Global Offensive) Отсутствует в FGD!
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.
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}}
Результат отображается в самом верху этой страницы.
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 (en).
Template:Unsigned is for talk pages. It should be added at the ends of unsigned comments. {{unsigned|JeffLane}}
Неподписанный коментарий добавлен JeffLane (разговорвклад)

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

Специальные метки - это символьные строки, которые являются своего рода шаблонами. Чтобы применить одну из них, просто введите её на странице.

__TOC__

Указывает место размещения оглавления на странице.

__FORCETOC__

Предписывает разместить оглавление в обычном месте. (Полезно для страниц, на которых недостаточно разделов для автоматического отображения оглавления)

__NOTOC__

Предписывает скрыть оглавление страницы.

__HIDDENCAT__

Помечает категорию как скрытую. Чтобы сайт отображал скрытые категории для вас, установите флажок Показывать скрытые категории в разделе Настройки.

__NOINDEX__

Указывает поистовым роботам не индексировать содержимое страницы, чтобы они не отображались в результатах поиска. Также добавляет страницу в категорию Неиндексируемые страницы (en). 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}}

Подменяет отображение заголовка страницы только на верхней панели.

Смотри также

  • Special:ExpandTemplates (en) - Показывает полностью обработанные шаблоны, включая замену кода wiki-текста и автоматическую подстановку всех вложенных шаблонов.
  • Special:MostTranscludedPages (en) - Список шаблонов, наиболее часто используемых на страницах. На самом деле это будут не только шаблоны, но и любые интегрированные страницы.
  • Special:UncategorizedTemplates (en) - Список шаблонов, которые не включены в категории.
  • Special:UnusedTemplates (en) - Список шаблонов, которые нигде не используются.
  • Special:WantedTemplates (en) - Список шаблонов, которые использованы на страницах, но не существуют. В идеале этот список должен быть пустым.
  • Wikipedia:Help:Magic_words_for_beginners - Подробнее о специальных метках.
  • Wikipedia:Help:Template - Очень полезный ресурс для программирования шаблонов..
  • New Help Desk (en) - Остались вопросы? Спросите здесь.