Difference between revisions of "Template:RU/documentation/mastertoc"
From Wiki
Jump to navigationJump to search (удалено >) |
|||
(17 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | <noinclude>{{CoreCriticalTemplate}}{{doc}} | ||
+ | [[Category:RU/wiki templates]] | ||
+ | </noinclude> | ||
+ | <!-- | ||
+ | <noinclude>{{tlinks|lc=.|dislooklink=yes|dishistlink=yes|diswatchlink=yes|fontsize=16}} | ||
+ | |||
+ | |||
+ | </noinclude> | ||
+ | --> | ||
<div id="tocwrapper" clear:both; class="docooo_tocwrapper" style="float:right; width: 200px; padding: 0px; border: 3px solid #fff; border-left: 20px solid #fff; border-bottom: 20px solid #fff; margin-left: 40px; margin-bottom: 20px; margin-top: -5px;"> | <div id="tocwrapper" clear:both; class="docooo_tocwrapper" style="float:right; width: 200px; padding: 0px; border: 3px solid #fff; border-left: 20px solid #fff; border-bottom: 20px solid #fff; margin-left: 40px; margin-bottom: 20px; margin-top: -5px;"> | ||
Line 10: | Line 19: | ||
{|border=0 width=100% | {|border=0 width=100% | ||
|- | |- | ||
− | |style="text-align:left;"|<span style="display: {{{ShowPrevPart|none}}}">[[{{{PrevPart}}}| | + | |style="text-align:left;"|<span style="display: {{{ShowPrevPart|none}}}">[[{{{PrevPart}}}|← {{RU/documentation/toc/toc_ru|Previous Section}} - {{{PrevPartName}}}]]</span> |
− | |style="text-align:right;"|<span style="display: {{{ShowNextPart|none}}}">[[{{{NextPart}}}|{{RU/documentation/toc/toc_ru|Next Section}} - {{{NextPartName}}}]]</span> | + | |style="text-align:right;"|<span style="display: {{{ShowNextPart|none}}}">[[{{{NextPart}}}|{{RU/documentation/toc/toc_ru|Next Section}} - {{{NextPartName}}} →]]</span> |
|} | |} | ||
</div> | </div> | ||
Line 21: | Line 30: | ||
{|border=0 width=100% | {|border=0 width=100% | ||
|- | |- | ||
− | |style="text-align:left;"|<span style="display: {{{ShowPrevPage|none}}}">[[{{{PrevPage}}}| | + | |style="text-align:left;"|<span style="display: {{{ShowPrevPage|none}}}">[[{{{PrevPage}}}|←{{RU/documentation/toc/toc_ru|Previous Page}}]]</span> |
− | |style="text-align:right;"|<span style="display: {{{ShowNextPage|none}}}">[[{{{NextPage}}}|{{RU/documentation/toc/toc_ru|Next Page}}]]</span> | + | |style="text-align:right;"|<span style="display: {{{ShowNextPage|none}}}">[[{{{NextPage}}}|{{RU/documentation/toc/toc_ru|Next Page}}→]]</span> |
|} | |} | ||
</div> | </div> | ||
Line 45: | Line 54: | ||
;NextPart:the path to the first page of the next part (no surrounding "[") | ;NextPart:the path to the first page of the next part (no surrounding "[") | ||
− | {{ | + | {{Note|The style classes are not yet created in the css file}} |
=== Simulated example === | === Simulated example === | ||
Line 135: | Line 144: | ||
</div> | </div> | ||
</noinclude> | </noinclude> | ||
+ | <!-- | ||
<noinclude> | <noinclude> | ||
[[Category:Documentation/Templates]] | [[Category:Documentation/Templates]] | ||
[[Category:Exclude in print|{{PAGENAME}}]] | [[Category:Exclude in print|{{PAGENAME}}]] | ||
[[Category:Wiki Templates for Navigation]] | [[Category:Wiki Templates for Navigation]] | ||
+ | </noinclude> | ||
+ | --> | ||
+ | <noinclude> | ||
+ | [[Category:RU/wiki templates/TOC]] | ||
</noinclude> | </noinclude> |
Latest revision as of 12:12, 25 August 2011
Критически важный опорный шаблон — Core Critical Template.
Необдуманное вмешательство в шаблон может повлечь за собой разрушение всего проекта! | Unconsidered intervention in the template may result in the destruction of the entire project! |
Документация — Documentation
Этому шаблону не хватает документации (подстраницы ./doc). | This pattern is not enough documentation (subpage ./doc). | |
Вы можете помочь проекту, сделав описание шаблона: что он делает, как его использовать, какие параметры он принимает. Это поможет другим людям использовать его. Для оформления можете воспользоваться {{doc}}. Не забывайте помещать описание внутрь <noinclude></noinclude>. |
You can help by making the description of a template: what it does, how to use it, what parameters it takes. This will help other people to use it. For decor you can use {{doc}}. Do not forget to put the description into <noinclude></noinclude>. |
|
Usage of Parameters
- ShowPrevPage
- set to "block" to show the "previous page" link, set to "none" to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is "passed through" the TOC to this template and therefore must explicitly be set to none to hide the link. The TOC must use {{{ShowPrevPage}}} as the parameter value to ensure passing along.
- PrevPage
- the path to the previous page (no surrounding "[")
- ShowNextPage
- set to "block" to show the "next page" link, set to "none" to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is "passed through" the TOC to this template and therefore must explicitly be set to none to hide the link. The TOC must use {{{ShowNextPage}}} as the parameter value to ensure passing along.
- NextPage
- the path to the previous page (no surrounding "[")
- bookid
- The id for the book (not yet evaluated)
- booktitle
- The book title that appears at the top of the TOC in full wiki syntax (i.e. as a link: [[MyGuide|My Great Manual]]
- ShowParttitle
- set to "block" to show the part title. This will be used in Sub-TOCs. It will default to hidden when not specified.
- parttitle
- The title of the part that this Sub-TOC covers in full wiki syntax (i.e. as a link: [[MyGuide/MyPart|Part 1: My Great Part]]
- toccontent
- The content of the TOC as lists and divs.
- ShowPrevPart
- set to "block" in to show the "previous part" link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.
- PrevPart
- the path to the first page of the previous part (no surrounding "[")
- ShowNextPart
- set to "block" in to show the "previous part" link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.
- NextPart
- the path to the first page of the next part (no surrounding "[")
Simulated example
- ShowPrevPage set to none
- ShowNextPage set to block
- NextPage set to The Next Page
- bookid set to 1234
- booktitle set to [[My Manual]]
- ShowParttitle set to block
- parttitle set to [[The First Part]]
- ShowPrevPart set to none
- ShowNextPart set to block
- NextPart set to The Second Part
- toccontent set to * Chapter
* Chapter
* Chapter
Calculated example
(note: not usable in preview mode while editing this template):
{{Documentation/MasterTOC |ShowPrevPage=none |ShowNextPage=block |NextPage=The Next Page |bookid=1234''' |booktitle=[[My Manual]] |ShowParttitle=block |parttitle=[[The First Part]] |ShowPrevPart=none |ShowNextPart=block |NextPart=The Second Part |toccontent=* Chapter * Chapter * Chapter }}
will be: