Template:Book

From open-support.info

(Difference between revisions)
Jump to: navigation, search
m
m
 
(64 intermediate revisions not shown)
Line 1: Line 1:
-
{{#if:{{Book/Lang}}
+
{{Documentation
-
|{{book/core
+
|desc=A semantic template to manage a set of sequential pages like a traditional "Book".
-
|lang=/{{BASEPAGENAME}}
+
|author=Dick6809
-
|root={{#titleparts:{{FULLPAGENAME}}|1}}
+
}}
-
|home={{#titleparts:{{FULLPAGENAME}}|1}}/{{SUBPAGENAME}}
+
<onlyinclude><includeonly>{{#vardefine:root|{{#titleparts:{{FULLPAGENAME}}|1}}
-
|head={{
+
}}{{#vardefine:path|{{#if:{{#titleparts:{{PAGENAME}}|-1}}|{{#titleparts:{{PAGENAME}}||2}}}}
-
  #if:{{{heading|}}}
+
}}{{#vardefine:main|{{#if:{{{master page|}}}
-
  |{{{heading}}}
+
  |{{{master page}}}
-
  |{{#show:{{NAMESPACE}}:{{BASEPAGENAME}}|?book heading}}
+
|{{#if:{{#var:path}}
-
  }}
+
   |{{#if:{{#show:{{#var:root}}|?docinfo master page#}}
-
  |name={{
+
   |{{#show:{{#var:root}}|?docinfo master page#}}/{{#var:path}}
-
  #if:{{{title|}}}
+
-
  |{{{title}}}
+
-
   |{{
+
-
  #if:{{#show:{{NAMESPACE}}:{{BASEPAGENAME}}|?book title}}
+
-
   |{{#show:{{NAMESPACE}}:{{BASEPAGENAME}}|?book title}}
+
-
  |{{PAGENAME}}
+
   }}
   }}
   }}
   }}
-
|next={{#show:{{NAMESPACE}}:{{BASEPAGENAME}}|?book next#}}/{{SUBPAGENAME}}
 
-
|prev={{
 
-
  #titleparts:{{
 
-
  #ask:
 
-
  [[Category:Books]]
 
-
  [[bookNext::{{PAGENAME}}]]
 
-
  |format=list
 
-
  |limit=1
 
-
  |link=none
 
-
  }}
 
-
  |-1
 
-
  }}/{{SUBPAGENAME}}
 
-
}}{{
 
-
#if:{{{root|}}}
 
-
|{{#set:book root={{{root}}} }}
 
-
}}{{
 
-
#if:{{{lang|}}}
 
-
|{{#set:book lang={{{lang}}} }}
 
-
}}{{
 
-
#if:{{{next|}}}
 
-
|{{#set:book next={{{next}}}{{{lang|}}} }}
 
-
}}{{docinfo
 
-
|master page={{NAMESPACE}}:{{BASEPAGENAME}}
 
-
|master rev ={{{master rev|}}}
 
-
|status    ={{{status|}}}
 
-
|progress  ={{{progress|}}}
 
-
|priority  ={{{priority|}}}
 
-
|author    ={{{author|}}}
 
-
|editor    ={{{editor|}}}
 
-
|support    ={{{support|}}}
 
-
|category  ={{{category|}}}
 
-
|desc      ={{{desc|}}}
 
  }}
  }}
-
|{{book/core
+
}}{{#ifeq:{{#var:main}}|{{FULLPAGENAME}}
-
|lang=
+
|{{#vardefine:main|}}
-
  |root={{#titleparts:{{FULLPAGENAME}}|1}}
+
|
-
  |home={{#titleparts:{{FULLPAGENAME}}|1}}
+
}}{{#if:{{#var:path}}
-
  |head={{#if:{{{heading|}}}|{{{heading}}}|}}
+
|{{ #vardefine:stat|{{#if:{{{status|}}|{{{status}}}  |{{#show:{{#var:root}}|?docinfo status}}}}
-
  |next={{#if:{{{next|}}}|{{#rel2abs:{{{next}}} }}}}
+
  }}{{#vardefine:prog|{{#if:{{{progress|}}}|{{{progress}}}|{{#show:{{#var:root}}|?docinfo progress}}}}
-
  |prev={{
+
  }}{{#vardefine:prio|{{#if:{{{priority|}}}|{{{priority}}}|{{#show:{{#var:root}}|?docinfo priority}}}}
-
  #ask:
+
}}{{#vardefine:cate|{{#if:{{{category|}}}|{{{category}}}|{{#show:{{#var:root}}|format=list|?docinfo category#}}}}
-
  [[Category:Books]]
+
  }}{{#vardefine:auth|{{#if:{{{author|}}}  |{{{author}}}  |{{#show:{{#var:root}}|format=list|?docinfo author#}}}}
-
  [[bookNext::{{PAGENAME}}]]
+
}}{{#vardefine:edit|{{#if:{{{editor|}}}  |{{{editor}}}  |{{#show:{{#var:root}}|format=list|?docinfo editor#}}}}
-
  |format=list
+
}}{{#vardefine:supp|{{#if:{{{support|}}} |{{{support}}} |{{#show:{{#var:root}}|format=list|?docinfo support#}}}}
-
  |limit=1
+
}}{{#vardefine:lang|{{#if:{{{lang|}}}    |{{{lang}}}    |{{#show:{{#var:root}}|?docinfo language}}}}
-
  |link=none
+
}}
-
  }}
+
|{{  #vardefine:stat|{{{status|}}}
-
  }}{{
+
  }}{{#vardefine:prog|{{{progress|}}}
-
  #if:{{{chain|}}}
+
  }}{{#vardefine:prio|{{{priority|}}}
-
  |{{#set:book next={{{next}}} }}
+
  }}{{#vardefine:cate|{{{category|}}}
-
  }}{{
+
}}{{#vardefine:auth|{{{author|}}}
-
  #if:{{{root|}}}
+
}}{{#vardefine:edit|{{{editor|}}}
-
  |{{#set:book root={{{root}}} }}
+
  }}{{#vardefine:supp|{{{support|}}}
-
  }}{{
+
  }}{{#vardefine:lang|{{{lang|}}}
-
  #if:{{{lang|}}}
+
}}
-
  |{{#set:book lang={{{lang}}} }}
+
}}{{#if:{{#var:main}}
-
  }}{{
+
|{{  #vardefine:mrev|{{{master rev|}}}
-
  #if:{{{next|}}}
+
  }}{{#vardefine:head|{{#if:{{{heading|}}}|{{{heading}}}|{{#show:{{#var:main}}|?book heading}}}}
-
  |{{#set:book next={{{next}}}{{{lang|}}} }}
+
  }}{{#vardefine:titl|{{#if:{{{title|}}}  |{{{title}}}  |{{#show:{{#var:main}}|?book title}}}}
-
}}{{docinfo
+
  }}{{#vardefine:next|{{#if:{{{next|}}}  |{{{next}}}  |{{#show:{{#var:main}}|?book next}}}}
-
  |status ={{{status|}}}
+
  }}{{#vardefine:desc|{{#if:{{{desc|}}}  |{{{desc}}}  |{{#show:{{#var:main}}|?description}}}}
-
|progress={{{progress|}}}
+
  }}
-
  |priority={{{priority|}}}
+
|{{  #vardefine:head|{{{heading|}}}
-
  |author ={{{author|}}}
+
  }}{{#vardefine:titl|{{{title|}}}
-
|editor  ={{{editor|}}}
+
}}{{#vardefine:next|{{{next|}}}
-
  |support ={{{support|}}}
+
}}{{#vardefine:desc|{{{desc|}}}
-
|category={{{category|}}}
+
}}
-
  |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>
 +
<!-- FOOTER NAVIGATION -->
 +
<div id="bookFooterNavSrc" style="display:none">
 +
<div id="bookFooterMargin"><br /></div>
 +
{| style="width:100%;<!--
 +
      --> font-size:85%;<!--
 +
      --> line-height:100%;<!--
 +
      --> 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:40%;<!--
 +
    --> vertical-align:bottom;<!--
 +
    --> 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>
 +
|}
 +
{{languages|{{#var:main}}}}
 +
{{documentation debug}}
 +
</div>
 +
{{DISPLAYTITLE:{{#if:{{#var:head}}|{{#var:head}}&nbsp;}}{{#var:titl}}
 +
}}{{docinfo
 +
|master page = {{#var:main}}
 +
|master rev = {{#var:mrev}}
 +
|status      = {{#var:stat}}
 +
|progress    = {{#var:prog}}
 +
|priority    = {{#var:prio}}
 +
|category    = {{#var:cate}}
 +
|author      = {{#var:auth}}
 +
|editor      = {{#var:edit}}
 +
|support     = {{#var:supp}}
 +
|lang        = {{#var:lang}}
 +
|desc        = {{#var:desc}}
 +
}}{{#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>
-
-->{{#if:{{{heading|}}}|{{#set:book heading={{{heading}}} }}}}<!--
+
{{documentation includeonly}}
-
-->{{#if:{{{title|}}}  |{{#set:book title  ={{{title}}}  }}}}<!--
+
</noinclude></onlyinclude>
-
--><noinclude>
+
-
{{documentation}}
+
-
</noinclude>
+

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