Добро пожаловать на Lesta Games Wiki!

Шаблон:Ship

Перейти к: навигация, поиск
Документация Документация

Использование

Это шаблон для упрощения ввода имен кораблей с викифицированной ссылкой на соответствующий корабль в формате "Линейный корабль "Петропавловск" (1914). Так как необходимо каждую ссылку предварять именем области Navy: количество вводимого текста удваивается. Например: [[Navy:Линейный корабль «Петропавловск» (1914)|Линейный корабль «Петропавловск»]]. Этот шаблон уполовинивает количество вводимого текста до {{ship|Линейный корабль|Петропавловск|1914}}.

Пример вики-кода

{{ship|Имя корабля}}
{{ship|Имя корабля|ID}}, где ID может быть годом спуска на воду, бортовым номером и пр. (в соответствии с наименованием статьи).

Примеры

Использование шаблона Эквивалентный вики-код Результат
{{ship|ARA|General Belgrano}} [[Navy:ARA General Belgrano|ARA ''General Belgrano'']] ARA General Belgrano
{{ship|HMS|Penelope|1935}} [[Navy:HMS Penelope (1935)|HMS ''Penelope'' (1935)]] HMS Penelope (1935)

Опциональный параметр отображения

There is an optional third parameter that controls which pieces of text are displayed in the article. Its value is treated as a binary number and will display the corresponding "bits". So setting the 4's bit will display USS, setting the 2's bit will display the ship name, and setting the 1's bit will display the ID. If you are unfamiliar with binary math, refer to these examples:

Значение параметра Показываемые
параметры
имени
Пример Эквивалентный вики-код Резкльтат
Без параметра все {{ship|HMS|Penelope|1935}} [[Navy:HMS Penelope (1935)|HMS ''Penelope'' (1935)]] HMS Penelope (1935)
1 3rd {{ship|HMS|Penelope|1935|1}} [[Navy:HMS Penelope (1935)|1935]] 1935
2 2nd {{ship|HMS|Penelope|1935|2}}} [[Navy:HMS Penelope (1935)|''Penelope'']] Penelope
3 2nd, 3rd {{ship|HMS|Penelope|1935|3}}} [[Navy:HMS Penelope (1935)|''Penelope'' (1935)]] Penelope (1935)
4 invalid result {{ship|HMS|Penelope|1935|4}}} [[Navy:HMS Penelope (1935)|Invalid Optional Parameter]] Неверный параметр, не используйте значение 4
5 1st, 3rd {{ship|HMS|Penelope|1935|5}}} [[Navy:HMS Penelope (1935)|HMS (1935)]] HMS (1935)
6 1st, 2nd {{ship|HMS|Penelope|1935|6}}} [[Navy:HMS Penelope (1935)|HMS ''Penelope'']] HMS Penelope
2nd
(no 3rd)
{{ship|Линейный корабль|Yamato|4=2}} Alternate usage: {{ship|Линейный корабль|Yamato||2}} [[Navy:Линейный корабль Yamato|''Yamato'']] Yamato

N.B.: Be careful with the third parameter if not using the second parameter. In the Yamato example above, the "|4=2" means set the fourth parameter to a value of two, while the alternate syntax shows using a pair of pipes, "||2", to position the value two in the fourth parameter position.

Опциональный параметр префикса

The parameter up (for unlinked prefix) can be used to have an unlinked prefix. When set to "yes", the template will display the prefix before the wikilink. This should be used with one of the optional display parameters above. (If not, it will result in a doubling of the prefix.)

Examples
  • {{ship|Линейный корабль|Yamato||2|up=yes}}

displays as:

  • Линейный корабль Yamato

Using without one of the optional display parameters:

  • {{ship|Линейный корабль|Yamato|up=yes}}

gives this:


See also

Шаблон:WPSHIPS shortcut templates

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