Template:Book

From open-support.info

(Difference between revisions)
Jump to: navigation, search
m
 
(72 intermediate revisions not shown)
Line 1: Line 1:
-
{{Book/Init
+
{{Documentation
-
}}{{#vardefine:book_next|{{#if:{{#var:book_lang}}
+
|desc=A semantic template to manage a set of sequential pages like a traditional "Book".
-
|{{#show:{{BASEPAGENAME}}|?bookNext#}}
+
|author=Dick6809
-
|{{#if:{{{3|}}}|{{#rel2abs:{{{3}}}}}}}
+
}}
 +
<onlyinclude><includeonly>{{#vardefine:root|{{#titleparts:{{FULLPAGENAME}}|1}}
 +
}}{{#vardefine:path|{{#if:{{#titleparts:{{PAGENAME}}|-1}}|{{#titleparts:{{PAGENAME}}||2}}}}
 +
}}{{#vardefine:main|{{#if:{{{master page|}}}
 +
|{{{master page}}}
 +
|{{#if:{{#var:path}}
 +
  |{{#if:{{#show:{{#var:root}}|?docinfo master page#}}
 +
  |{{#show:{{#var:root}}|?docinfo master page#}}/{{#var:path}}
 +
  }}
 +
  }}
  }}
  }}
-
}}{{#vardefine:book_prev|{{#if:{{#var:book_lang}}
+
}}{{#ifeq:{{#var:main}}|{{FULLPAGENAME}}
-
  |{{#titleparts:{{#ask:[[Category:Books]][[bookNext::{{PAGENAME}}]]|format=list|limit=1|link=none}}|-1}}
+
|{{#vardefine:main|}}
-
  |{{#ask:[[Category:Books]][[bookNext::{{PAGENAME}}]]|format=list|limit=1|link=none}}
+
|
 +
}}{{#if:{{#var:path}}
 +
|{{ #vardefine:stat|{{#if:{{{status|}}}  |{{{status}}}  |{{#show:{{#var:root}}|?docinfo status}}}}
 +
}}{{#vardefine:prog|{{#if:{{{progress|}}}|{{{progress}}}|{{#show:{{#var:root}}|?docinfo progress}}}}
 +
}}{{#vardefine:prio|{{#if:{{{priority|}}}|{{{priority}}}|{{#show:{{#var:root}}|?docinfo priority}}}}
 +
}}{{#vardefine:cate|{{#if:{{{category|}}}|{{{category}}}|{{#show:{{#var:root}}|format=list|?docinfo category#}}}}
 +
}}{{#vardefine:auth|{{#if:{{{author|}}|{{{author}}}  |{{#show:{{#var:root}}|format=list|?docinfo author#}}}}
 +
}}{{#vardefine:edit|{{#if:{{{editor|}}}  |{{{editor}}}  |{{#show:{{#var:root}}|format=list|?docinfo editor#}}}}
 +
}}{{#vardefine:supp|{{#if:{{{support|}}} |{{{support}}} |{{#show:{{#var:root}}|format=list|?docinfo support#}}}}
 +
}}{{#vardefine:lang|{{#if:{{{lang|}}}    |{{{lang}}}    |{{#show:{{#var:root}}|?docinfo language}}}}
  }}
  }}
-
}}{{#vardefine:book_head|{{#if:{{{1|}}}
+
|{{ #vardefine:stat|{{{status|}}}
-
  |{{{1}}}
+
}}{{#vardefine:prog|{{{progress|}}}
-
  |{{#if:{{#var:book_lang}}|{{#show:{{#var:book_base}}|?bookHeading}}}}
+
  }}{{#vardefine:prio|{{{priority|}}}
 +
  }}{{#vardefine:cate|{{{category|}}}
 +
}}{{#vardefine:auth|{{{author|}}}
 +
}}{{#vardefine:edit|{{{editor|}}}
 +
}}{{#vardefine:supp|{{{support|}}}
 +
}}{{#vardefine:lang|{{{lang|}}}
  }}
  }}
-
}}{{DISPLAYTITLE:{{#if:{{#var:book_head}}|{{#var:book_head}}&nbsp;}}{{{2|}}}}}
+
}}{{#if:{{#var:main}}
-
<!-- NavLink -->
+
|{{  #vardefine:mrev|{{{master rev|}}}
-
<div id="bookTestSrc" style="display:none">
+
}}{{#vardefine:head|{{#if:{{{heading|}}}|{{{heading}}}|{{#show:{{#var:main}}|?book heading}}}}
-
<span class="subpage" style="float:right">{{
+
}}{{#vardefine:titl|{{#if:{{{title|}}}  |{{{title}}}  |{{#show:{{#var:main}}|?book title}}}}
-
#if:{{#var:book_prev}}|{{Book/Link|{{#var:book_prev}}|{{#var:book_msg_navprev}}}} &#124;&nbsp;}}{{
+
}}{{#vardefine:next|{{#if:{{{next|}}}  |{{{next}}}  |{{#show:{{#var:main}}|?book next}}}}
-
#if:{{#titleparts:{{PAGENAME}}|-1}}|{{Book/Link|..|{{#var:book_msg_navup}}}} &#124;&nbsp;}}{{
+
}}{{#vardefine:desc|{{#if:{{{desc|}}}  |{{{desc}}}  |{{#show:{{#var:main}}|?description}}}}
-
#if:{{#var:book_next}}|{{Book/Link|{{#var:book_next}}|{{#var:book_msg_navnext}}}}}}</span>
+
}}
 +
|{{  #vardefine:head|{{{heading|}}}
 +
}}{{#vardefine:titl|{{{title|}}}
 +
}}{{#vardefine:next|{{{next|}}}
 +
}}{{#vardefine:desc|{{{desc|}}}
 +
}}
 +
}}{{#vardefine:prev|{{#ask:
 +
[[Category:Books]]
 +
[[book chain::{{FULLPAGENAME}}]]
 +
|format = list
 +
|limit = 1
 +
|link = none
 +
}}
 +
}}<!-- HEADER NAFVIGATION -->
 +
<div id="bookHeaderNavSrc" style="display:none">
 +
<span class="subpage" style="float:right">{{#if:{{#var:prev}}
 +
|{{Book/Link|{{#var:prev}}|{{message|Prev|dict=nav|nocat}}}} &#124;&nbsp;
 +
}}{{#if:{{#titleparts:{{PAGENAME}}|-1}}
 +
|{{Book/Link|..|{{message|Up|dict=nav|nocat}}}} &#124;&nbsp;
 +
}}{{#if:{{#var:next}}
 +
|{{Book/Link|{{#var:next}}|{{message|Next|dict=nav|nocat}}}}
 +
}}</span>
</div>
</div>
-
<!-- Footer -->
+
<!-- FOOTER NAVIGATION -->
-
<div id="bookFooterSrc" style="display:none">
+
<div id="bookFooterNavSrc" style="display:none">
<div id="bookFooterMargin"><br /></div>
<div id="bookFooterMargin"><br /></div>
-
{| style="width:100%;font-size:85%;line-height:85%;margin:1em 0px 0px 0px;padding:0px;white-space:nowrap"
+
{| style="width:100%;<!--
-
| style="width:35%;vertical-align:bottom;text-align:left" |<span class="subpages">{{Book/Link|{{#var:book_prev}}|{{#var:book_msg_navprev}}}}</span>
+
      --> font-size:85%;<!--
-
| style="width:30%;vertical-align:bottom;text-align:center"|<span class="subpages">{{Book/Link|..|{{#var:book_msg_navup}}}}</span>
+
      --> line-height:100%;<!--
-
| style="width:35%;vertical-align:bottom;text-align:right" |<span class="subpages">{{Book/Link|{{#var:book_next}}|{{#var:book_msg_navnext}}}}</span>
+
      --> margin:1em 0px 0px 0px;<!--
 +
      --> padding:0px; <!--
 +
      --> white-space:nowrap;<!--
 +
      -->"  
 +
|style="vertical-align:bottom;<!--
 +
    --> text-align:left;<!--
 +
    -->"|<span class="subpages">{{Book/Link
 +
|{{#var:prev}}
 +
|&lt;&nbsp;{{message|Prev|dict=nav|nocat}}
 +
}}</span>
 +
|style="vertical-align:bottom;<!--
 +
    --> text-align:center;<!--
 +
    -->"|<span class="subpages">{{Book/Link
 +
|..
 +
|{{message|Up|dict=nav|nocat}}
 +
}}</span>
 +
|style="vertical-align:bottom;<!--
 +
    --> text-align:right;<!--
 +
    -->"|<span class="subpages">{{Book/Link
 +
|{{#var:next}}
 +
|{{message|Next|dict=nav|nocat}}&nbsp;&gt;
 +
}}</span>
|-
|-
-
| style="width:35%;vertical-align:bottom;text-align:left" |<span class="subpages">{{Book/Link|{{#var:book_prev}}}}</span>
+
|style="width:40%;<!--
-
| style="width:30%;vertical-align:bottom;text-align:center"|<span class="subpages">{{Book/Link|{{#var:book_root}}}}</span>
+
    --> vertical-align:bottom;<!--
-
| style="width:35%;vertical-align:bottom;text-align:right" |<span class="subpages">{{Book/Link|{{#var:book_next}}}}</span>
+
    --> text-align:left;<!--
 +
    --> white-space:nowrap;<!--
 +
    -->"|<span class="subpages">{{Book/Link|{{#var:prev}}|show=all}}</span>
 +
|style="width:20%;<!--
 +
    --> vertical-align:bottom;<!--
 +
    --> text-align:center;<!--
 +
    --> white-space:nowrap;<!--
 +
    -->"|<span class="subpages">{{Book/Link|{{#var:root}}|show=all}}</span>
 +
|style="width:40%;<!--
 +
    --> vertical-align:bottom;<!--
 +
    --> text-align:right;<!--
 +
    --> white-space:nowrap;<!--
 +
    -->"|<span class="subpages">{{Book/Link|{{#var:next}}|show=all}}</span>
|}
|}
-
{{Translations}}
+
{{languages|{{#var:main}}}}
 +
{{documentation debug}}
</div>
</div>
-
<!-- {{#if:{{{1|}}}|{{#set:bookPageHeading={{{1}}}}}
+
{{DISPLAYTITLE:{{#if:{{#var:head}}|{{#var:head}}&nbsp;}}{{#var:titl}}
-
}}{{#if:{{{2|}}}|{{#set:bookPageTitle={{{2}}}}}
+
}}{{docinfo
-
}}{{#if:{{{3|}}}|{{#set:bookPageNext={{{3|}}}}}
+
|master page = {{#var:main}}
-
}}{{#if:{{{4|}}}|{{#set:bookPagePrev={{{4|}}}}}
+
|master rev  = {{#var:mrev}}
-
}} -->
+
|status      = {{#var:stat}}
-
{{#if:{{{1|}}}|{{#set:bookHeading={{{1|}}}}}
+
|progress    = {{#var:prog}}
-
}}{{#if:{{{2|}}}|{{#set:bookTitle={{{2|}}}}}
+
|priority    = {{#var:prio}}
-
}}{{#if:{{{3|}}}|{{#set:bookChain={{{3|}}}}}
+
|category    = {{#var:cate}}
-
}}{{#if:{{#var:book_root}}|{{#set:bookRoot={{#var:book_root}}}}
+
|author      = {{#var:auth}}
-
}}{{#if:{{#var:book_lang}}|{{#set:bookLang={{#var:book_lang}}}}
+
|editor      = {{#var:edit}}
-
}}{{#if:{{#var:book_next}}|{{#set:bookNext={{#var:book_next}}{{#var:book_lang}}}}
+
|support    = {{#var:supp}}
-
}}
+
|lang        = {{#var:lang}}
-
<includeonly>[[Category:Books]][[Category:{{#var:book_home}}]]</includeonly><noinclude>
+
|desc        = {{#var:desc}}
-
{{documentation}}
+
}}{{#if:{{#var:head}}|{{#set:book heading={{#var:head}}}}
 +
}}{{#if:{{#var:titl}}|{{#set:book title  ={{#var:titl}}}}
 +
}}{{#if:{{#var:next}}|{{#set:
 +
|book next  ={{#var:next}}
 +
|book chain ={{#rel2abs:{{#replace:{{#var:next}}|~|{{#var:root}}}}|{{FULLPAGENAME}}}}
 +
}}
 +
}}[[Category:Books|{{PAGENAME}}]]</includeonly><noinclude>
 +
{{documentation includeonly}}
 +
</noinclude></onlyinclude>

Latest revision as of 12:49, 29 April 2011

[edit] [purge] Template documentation

Template:Book – a semantic template to manage a set of sequential pages like a traditional "Book". This is the "Book" template. It should be called in the following format:

{{Book
|1=
|2=
|3=
}}

Edit the page to see the template text.

The results of this template are not shown here.


Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox