Difference between revisions of "Template:MasterTOC"
From Wiki
Jump to navigationJump to search (Основной текст) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<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;"> | ||
− | |||
<div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div> | <div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div> | ||
− | + | <div id="{{{bookid}}}" style="border:1px solid #9BC0F5; padding: 0px; font-size: x-small; background-color: #FFF;"> | |
− | <div id="{{{bookid}}}" style="border:1px solid #9BC0F5; padding: 0px; font-size: | ||
<div id="doc_toctitle" class="docooo_toctitle docsection">{{{booktitle}}}</div> | <div id="doc_toctitle" class="docooo_toctitle docsection">{{{booktitle}}}</div> | ||
<div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:{{{ShowParttitle|none}}}"> | <div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:{{{ShowParttitle|none}}}"> | ||
Line 10: | Line 8: | ||
{|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}}}|← {{TOC_{{{Lang|en}}}|Previous Section}}]]</span> |
− | |style="text-align:right;"|<span style="display: {{{ShowNextPart|none}}}">[[{{{NextPart}}}|{{ | + | |style="text-align:right;"|<span style="display: {{{ShowNextPart|none}}}">[[{{{NextPart}}}|{{TOC_{{{Lang|en}}}|Next Section}} →]]</span> |
|} | |} | ||
</div> | </div> | ||
Line 21: | Line 19: | ||
{|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}}}|← {{TOC_{{{Lang|en}}}|Previous Page}}]]</span> |
− | |style="text-align:right;"|<span style="display: {{{ShowNextPage|none}}}">[[{{{NextPage}}}|{{ | + | |style="text-align:right;"|<span style="display: {{{ShowNextPage|none}}}">[[{{{NextPage}}}|{{TOC_{{{Lang|en}}}|Next Page}} →]]</span> |
|} | |} | ||
</div> | </div> | ||
Line 65: | Line 63: | ||
<div id="tocwrapper" class="docooo_tocwrapper" style="width: 200px; padding: 0px; border: 5px solid #fff;"> | <div id="tocwrapper" class="docooo_tocwrapper" style="width: 200px; padding: 0px; border: 5px solid #fff;"> | ||
<div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div> | <div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div> | ||
− | <div id="1234" style="border:1px solid #9099a8; padding: 0px; font-size: | + | <div id="1234" style="border:1px solid #9099a8; padding: 0px; font-size: x-small; background-color: #FFF;"> |
<div id="toctitle" class="docooo_toctitle" style="background-color: #c5d0e1; border: 0px solid #9099a8; padding: 1px;font-weight: bold; text-align: left; font-size:120%;">[[My Manual]]</div> | <div id="toctitle" class="docooo_toctitle" style="background-color: #c5d0e1; border: 0px solid #9099a8; padding: 1px;font-weight: bold; text-align: left; font-size:120%;">[[My Manual]]</div> | ||
<div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:block"> | <div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:block"> | ||
Line 73: | Line 71: | ||
{|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}}}|← Previous Part]]</span> |
− | |style="text-align:right;"|<span style="display: block">[[The Second Part|Next Part | + | |style="text-align:right;"|<span style="display: block">[[The Second Part|Next Part →]]</span> |
|} | |} | ||
</div> | </div> | ||
Line 85: | Line 83: | ||
{|border=0 width=100% | {|border=0 width=100% | ||
|- | |- | ||
− | |style="text-align:left;"|<span style="display: none">[[{{{PrevPage}}}| | + | |style="text-align:left;"|<span style="display: none">[[{{{PrevPage}}}|← Previous Page]]</span> |
− | |style="text-align:right;"|<span style="display: block">[[The Next Page|Next Page | + | |style="text-align:right;"|<span style="display: block">[[The Next Page|Next Page →]]</span> |
|} | |} | ||
</div> | </div> |
Latest revision as of 12:51, 7 October 2011
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):
{{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: