MediaWiki CMS:Шаблоны/Навигационный блок №1

Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску

Проверка/Оформление/Редактирование: Мякишев Е.А.


Навигационный блок №1

Шаблон, для блока навигации.

Пример использования

{{Навигационный блок1
|color = red
|category = Заголовок
|content = 
Тест<br>
Тест<br>
Тест<br>
Тест<br>
Тест<br>
Тест<br>
Тест<br>
Тест<br>
Тест<br>
}}
Тест

Тест
Тест
Тест
Тест
Тест
Тест
Тест

Тест











Код

<noinclude>
Main page link block template.

===Example===
</noinclude><div class="mainpage-block">
<div class="mainpage-block_title"><div class="mainpage-block_title-left" style="background:{{theme colour|{{{color}}}}}">&nbsp;</div><div class="mainpage-block_title-right">{{#if: {{{category|}}} | [[:Category:{{{category|Stubs}}}|<span>{{{title|{{{category|Untitled}}}}}}</span>]] | <span>{{{title|Untitled}}}</span> }}</div><div class="mainpage-block_clear"></div></div>
<div class="mainpage-block_inner">{{{content|Nothing to see here}}}</div>
</div><noinclude>
<br style="clear:both" />
===Parameters===
;color
:Color used for the top-left blocky thing; one of "red", "green", "blue" or "grey"
;category
:Category name for the box; this will become a hyperlink, so use only ''title'' if you do not have a category to link to
;title
:Title if different from the category name, or if no category hyperlink is to be used
;content
:Content of the box

===Usage notes===
Main page link blocks are designed to have zero additional spacing between lines, but MediaWiki will "randomly" add blank lines for no clear reason. As such, all &lt;ul&gt; and &lt;p&gt; spacing is removed by way of CSS on [[MediaWiki:Common.css]] linked to classes in this template. Do not be alarmed; this behavior is intentional.
</noinclude>

Зависимости

Шаблоны

Theme colour

<noinclude>
Replaces parameter of "red"/"1", "green"/"2", "blue"/"3" or "grey"/"0"/"4" with the appropriate theme colour as a CSS colour value. Any other value returns orange. Numeric values can be used for automated colour generation.
</noinclude><includeonly>{{#switch: {{{1}}}
 | 1     = #d81e1e
 | red   = #d81e1e
 | 2     = #519524
 | green = #519524
 | 3     = #1A51C3
 | blue  = #1A51C3
 | 0     = #444444
 | 4     = #444444
 | grey  = #444444
 | orange
}}</includeonly>

См.также

Внешние ссылки