Шаблон:Ombox/Документация: различия между версиями

Содержимое удалено Содержимое добавлено
Нет описания правки
Строка 1:
<noinclude>{{docpage}}</noinclude>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
Этот мета-шаблон (other pages message box) используется для формирования информационных сообщений в пространствах "Участник", "Викисловарь", "MediaWiki", "Шаблон", "Справка", и других, которые не покрываются шаблонами {{шаблон|ambox}}, {{шаблон|tmbox}}, {{шаблон|imbox}} или {{шаблон|cmbox}}. Поэтому он '''не должен''' использоваться на страницах словарных статей, страницах обсуждения, страницах изображений и страницах категорий.
{{mbox templates}}
This is the {{tl|ombox}} or '''other pages message box''' meta-template.
 
Этот шаблон подобен шаблону {{шаблон|ambox}} и использует большинство его параметров.
It is used to build message box templates for pages of the types: User, Wikipedia, MediaWiki, Template, Help, Portal and any new future namespaces. That is, page types not covered by {{tl|ambox}}, {{tl|tmbox}}, {{tl|imbox}} or {{tl|cmbox}}. Thus, it should ''not'' be used for boxes for articles, talk pages, image pages or category pages.
 
This template works almost exactly like {{tl|ambox}} and uses the same parameters.
 
=== We are deploying! ===
After discussions on the [[Template talk:Ombox|talk page]] of this template and announcing it at several places for some time we are now deploying this template. Feel free to convert any message boxes used on «other pages» to use this meta-template. If you find any tricky cases then list them on the talk page of this template and you’ll get help.
 
When this template is used to build other pages message boxes those boxes should contain explanatory texts just like before. (The same texts as before or new improved texts.) If there are more specific images in the boxes or you know a better image, then use them instead of the default images shown here.
 
=== Использование ===
Простое использование:
Простой пример:
 
<pre>
{{ombox | текстtext = Some text.}}
</pre>
 
{{ombox | текстtext = Some text.}}
{{-clear}}
 
Сложное использование:
Сложный пример:
 
<pre>
{{ombox
| тип type = стильstyle
| изображениеimage = [[ФайлImage:Emblem-question-yellow.svg|40px]]
| стиль style = width: 400px;
| стильтекстаtextstyle = color: red; font-weight: bold; font-style: italic;
| текст text = СообщениеThe message body text.
}}
</pre>
 
{{ombox
|тип type = стильstyle
|изображение image = [[ФайлImage:Emblem-question-yellow.svg|40px]]
|стиль style = width: 400px;
|стильтекста textstyle = color: red; font-weight: bold; font-style: italic;
|текст text = СообщениеThe message body text.
}}
{{-clear}}
 
=== Типы сообщений на других страницах ===
=== Other pages message box types ===
Следующие примеры используют различные значения параметра '''type''', но не меняют параметры отображения значка (иконки), поэтому везде отображается картинка по умолчанию.
The following examples use different '''type''' parameters but use no image parameters thus they use the default images for each type.
 
{{ombox
| type = speedy
| text = type=<u>speedy</u> – Speedyв deletionшаблонах templatesбыстрого удаления категории.
}}
{{ombox
| type = delete
| text = type=<u>delete</u> – Deletionв templatesшаблонах удаления категории.
}}
{{ombox
| type = content
| text = type=<u>content</u> – MajorВажные warningsпредупреждения andо problems, such as {{tl|high-risk}}предостережения.
}}
{{ombox
| type = style
| text = type=<u>style</u> – MinorОбычные warningsпредупреждения andо problems. {{tl|intricate}} should perhaps use this typeпредостережения.
}}
{{ombox
| type = notice
| text = type=<u>notice</u> – NoticesИнформационные and messages of any kindсообщения, both permanent and temporary. Such as {{tl|guideline}} and {{tl|Wikipediaпостоянные howи to}}временные.
}}
{{ombox
| type = move
| text = type=<u>move</u> – Merge,Сообщения splitо перемещении, rename and transwiki messagesслиянии andи proposalsразделении.
}}
{{ombox
| type = protection
| text = type=<u>protection</u> – ProtectionСообщения templatesо suchзащите as {{tl|pp-protected}} when shown on «other pages»страницы.
}}
 
 
=== Examples ===
=== Примеры использования ===
Some examples using the «notice» style:
Примеры использования в сообщениях типа "notice".
 
{{ombox
| text = NoНе typeзаданы andпараметры notype и image given ('''default'''по умолчанию)
}}
{{ombox
| image = none
| text = No Не заданы параметр type andи '''image=none''' – NoЗначок imageне isпоказывается used and the '''text'''и usesтекст theзанимает wholeвсю messageширину boxокна areaсообщения.
}}
{{ombox
Строка 96 ⟶ 90 :
| image = [[Image:Blue check.svg|30px]]
| imageright = {{shortcut|WP:SHORT}}
| text = '''Эта страница является частью [[:Категория:Викисловарь:Справочные материалы|правил и руководств]] Викисловаря.'''<br>
| text =
Изложенному здесь должны следовать все участники. Прежде чем редактировать, убедитесь, что вносимые изменения соответствуют [[Викисловарь:Консенсус|консенсусу]]. Если есть сомнения, обсудите на [[{{TALKPAGENAME}}|странице обсуждения]].
'''This page documents an English Wikipedia [[Wikipedia:Policies and guidelines|guideline]].''' It is a generally accepted standard that editors should follow, though it should be treated with [[Wikipedia:Use common sense|common sense]] and the [[Wikipedia:Ignore all rules|occasional exception]]. When editing this page, please ensure that your revision reflects [[Wikipedia:Consensus|consensus]]. When in doubt, discuss on the [[{{TALKPAGENAME}}|talk page]].
}}
{{ombox
Строка 103 ⟶ 97 :
| image = [[Image:Nutshell.png|30px]]
| text =
'''В двух словах:''' Этот шаблон используется для отображения информационного сообщения на странице '''не являющихся''' словарной статьёй, страницей обсуждения, страницей описания изображения и странице категории.
'''This page in a nutshell:''' This template is used to build message boxes for all pages that are ''not'' articles, talk pages, image pages or category pages.
}}
 
=== ParametersПараметры ===
Список всех параметров:
List of all parameters:
 
<pre>
Строка 125 ⟶ 119 :
 
'''type'''
:'''нет параметра''' = если параметр '''type''' не задан, то используется значение по умолчанию '''notice''' (голубой фон).
: If no '''type''' parameter is given the template defaults to type '''notice'''. That means it gets a gray border.
 
'''image'''
:'''нет параметра''' = если параметр '''image''' не задан, то используется значок по умолчанию в зависимости от того что задано в параметре '''type'''.
: '''No parameter''' = If no '''image''' parameter is given the template uses a default image. Which default image it uses depends on the '''type''' parameter.
:'''файл изображения''' = ссылка на файл использующая вики разметку. Размер подгоняется под 40px - 50px в ширину в зависимости от соотношения сторон в оригинале. (Но можно задать и произвольный размер.) Например:
: '''An image''' = Should be an image with usual wiki notation. 40px — 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
:: <code><nowiki>image = [[Image:Crystal package settingsSub-arrows.pngsvg|40px]]</nowiki></code>
: '''none''' = Meansобозначает, thatчто noне imageнужно isотображать usedзначок.
 
'''imageright'''
:'''нет параметра''' = если параметр '''imageright''' не задан, то значок справа не показывается.
: '''No parameter''' = If no '''imageright''' parameter is given then no image is shown on the right side.
:'''файл изображения''' = ссылка на файл использующая вики разметку. Размер подгоняется под 40px - 50px в ширину в зависимости от соотношения сторон в оригинале. (Но можно задать и произвольный размер.) Например:
: '''An image''' = Should be an image with usual wiki notation. 40px — 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
:: <code><nowiki>imageright = [[Image:Nuvola apps bookcase.png|40px]]</nowiki></code>
:'''одругое''' = все что вы хотите отобразить справа.
: '''Anything''' = Any other object that you want to show on the right side.
 
'''style'''
:Дополнительный параметр стиля CSS для всей таблицы. Например:
: Optional [[Cascading Style Sheets|CSS]] values used by the entire message box table. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example:
:: <code>style = margin-bottom: 0.5em;</code>
 
'''textstyle'''
:Дополнительный параметр стиля CSS для текстовой ячейки. Например:
: Optional [[Cascading Style Sheets|CSS]] values used by the text cell. For example:
:: <code>textstyle = text-align: center;</code>
 
'''text'''
:Текст сообщения.
: The message body text.
 
==== Параметры миниатюризации ====
 
==== The small parameters ====
{{ombox
| small = yes
Строка 161 ⟶ 156 :
}}
'''small'''
:'''yes''' = Создает маленькое окно сообщения прикрепляющееся к правому краю страницы. Этот параметр также уменьшает значок по умолчанию. Обратите внимание, что данные переданные в параметрах '''smallimage''', '''smallimageright''' и '''smalltext''' используются только если "small=yes". Чтобы производный шаблон понимал параметр small используйте следующий код:
: '''yes''' = Makes it a smaller right floating message box. This also makes the default images smaller. Note that any data fed to the '''smallimage''', '''smallimageright''' and '''smalltext''' parameters is only used if «small=yes». To make it so your template also understands the small parameter you can use this code:
:: <code><nowiki>small = {{{small|}}}</nowiki></code>
 
{{ombox
Строка 172 ⟶ 167 :
}}
'''smallimage'''
:'''нет параметра''' = если параметр '''smallimage''' не задан, то опять используется параметр '''image'''. Если параметр '''image''' также пустой, то используется маленький значок по умолчанию.
: '''No parameter''' = If no '''smallimage''' parameter is given then this template falls back to use the '''image''' parameter. If the '''image''' parameter also is empty then a small default image is used.
:'''файл изображения''' = ссылка на файл использующая вики разметку. Обычно около 20px для сообщений в одну строку и до 25px в ширину для двух строк текста. Например:
: '''An image''' = Should be an image with usual wiki notation. 30px width is usually about right. For example:
:: <code><nowiki>smallimage = [[ImageFile:ReplacementGnome filingglobe cabinetcurrent event.svg|30px20px|alt=Clock over a larger globe]]</nowiki></code>
: '''none''' = Meansобозначает, thatчто noне imageнужно isотображать usedзначок. ThisПереопределяет overrides any imageзаданное fedв toпараметре '''image''', whenкогда «"small=yes»left".
 
{{ombox
Строка 185 ⟶ 180 :
}}
'''smallimageright'''
: '''Noнет parameterпараметра''' = Ifесли noпараметр '''smallimageright''' parameterне isзадан, givenто thenо thisпять templateиспользуется falls back to use theпараметр '''imageright''' parameter. IfЕсли theпараметр '''imageright''' parameter also is empty then noтакже imageпустой, isто shownиспользуется onзначок theсправа rightне sideпоказывается.
:'''файл изображения''' = ссылка на файл использующая вики разметку. Около 30px в ширину. Например:
: '''An image''' = Should be an image with usual wiki notation. 30px width is usually about right. For example:
:: <code><nowiki>smallimageright = [[ImageFile:Nuvola apps bookcase.png|30px|alt=Three stacked books]]</nowiki></code>
:'''одругое''' = все что вы хотите отобразить справа.
: '''Anything''' = Any other object that you want to show on the right side.
: '''none''' = Meansобозначает, thatчто noне rightнужно sideотображать imageзначок is usedсправа. This overrides anyПереопределяет imageзаданное fedв toпараметре '''imageright''', whenкогда «"small=yes»".
 
'''smalltext'''
:Краткий вариант текста сообщения. Если параметр '''smalltext''' не задан, то пять используется параметр '''text'''.
: A shorter version of the message body text. If no '''smalltext''' parameter is given then this template falls back to use the '''text''' parameter.
 
=== TechnicalТехнические detailsдетали ===
Если вам необходимо использовать специальные символы внутри параметра '''text''', то вам необходимо заменять их ESC-последовательностями :
If you need to use special characters in the text parameter then you need to escape them like this:
 
<pre>
{{ombox
| text = <div>
Здесь знак равенства = открывающая и закрывающая фигурные скобки { }.
Equal sign = and a start and end brace { } work fine as they are.
ButА hereздесь isзнак aразделения pipeпараметров {{!}} andи twoдве endзакрывающие bracesфигурные скобки &lt;nowiki>}}&lt;/nowiki>.
А здесь знак разделения параметров перед двумя закрывающими фигурными скобками &lt;nowiki>|}}&lt;/nowiki>.
And now a pipe and end braces &lt;nowiki>|}}&lt;/nowiki>.
</div>
}}
Строка 209 ⟶ 204 :
{{ombox
| text = <div>
Здесь знак равенства = открывающая и закрывающая фигурные скобки { }.
Equal sign = and a start and end brace { } work fine as they are.
ButА hereздесь isзнак aразделения pipeпараметров {{!}} andи twoдве endугловые bracesскобки <nowiki>}}</nowiki>.
А здесь знак разделения параметров перед двумя закрывающими фигурными скобками <nowiki>|}}</nowiki>.
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}
 
This template uses the ombox CSS classes in [[MediaWiki:Common.css]] for most of its looks, thus it is fully skinnable.
 
Этот шаблон использует ombox [[w:CSS|CSS]] классы в [[MediaWiki:Common.css]] влияющие на его внешний вид, т.е. он полностью перенастраиваемый.
This template calls {{tl|ombox/core}} which holds most of the code for {{tl|ombox}}, while {{tl|ombox}} itself does parameter preprocessing.
 
Шаблон вызывает {{шаблон|ombox/core}} содержит весь исполняемый код для {{шаблон|ombox}}, когда как сам {{шаблон|ombox}} занимается предварительной обработкой параметров, тем самым упрощая {{шаблон|ombox/core}}.
Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use [[m:Help:ParserFunctions|parser functions]] and special characters in parameters.
 
Внутри шаблона для формирования кода таблицы используется язык разметки HTML вместо языка викиразметки. Так делается во всех мета-шаблонах, т.к. у вики-разметки есть ряд недостатков. Например, она затрудняет использование [[m:Help:ParserFunctions|функций парсера]] и специальных символов в параметрах.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
 
Файлы значков по умолчанию для этого мета-шаблона имеют формат png, а не svg. Основная причина в том, что у некоторых старых браузеров есть проблемы с отображением прозрачного фона, который подставляет MediaWiki движок для svg изображений. Все png изображение оптимизированы вручную и имеют прозрачный фон чтобы одинаково хорошо отображаться во всех браузерах. Обратите внимание, что svg значки выглядят плохо только в старых браузерах, поэтому такая ​​ручная оптимизация сделана только для наиболее часто использующихся иконок.
For more technical details see the [[Template talk:Ombox|talk page]]. Since this template works almost exactly like {{tl|ambox}}, {{tl|tmbox}}, {{tl|imbox}} and {{tl|cmbox}} their talk pages and related pages might also contain more details.
 
<!--
=== See also ===
=== См. также ===
{{Mbox templates see also}}
-->
 
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Категория:Вспомогательные шаблоны|{{PAGENAME}}]]
[[Категория:Википедия:Мета-шаблоны|{{PAGENAME}}]]
 
[[ar:قالب:Ombox]]
[[ba:Ҡалып:Ombox]]
[[ca:Plantilla:Metacaixa d'avís projecte]]
[[cy:Nodyn:Ombox]]
[[dsb:Pśedłoga:Ombox]]
[[en:Template:Ombox]]
[[hsb:Předłoha:Ombox]]
[[ia:Patrono:Ombox]]
[[ja:Template:Ombox]]
[[mk:Шаблон:Ombox]]
[[mn:Загвар:Ombox]]
[[pl:Szablon:Ombox]]
[[pt:Predefinição:Ombox]]
[[ro:Format:Meta-casetămap]]
[[sl:Predloga:Polje za ostale strani]]
[[tpi:Template:Ombox]]
[[uk:Шаблон:Ombox]]
[[ur:سانچہ:Ombox]]
[[zh:Template:Ombox]]
</includeonly>