Template:Book

From open-support.info

(Difference between revisions)
Jump to: navigation, search
m
m
 
(36 intermediate revisions not shown)
Line 1: Line 1:
-
<includeonly>{{#vardefine:root|{{#titleparts:{{FULLPAGENAME}}|1}}
+
{{Documentation
 +
|desc=A semantic template to manage a set of sequential pages like a traditional "Book".
 +
|author=Dick6809
 +
}}
 +
<onlyinclude><includeonly>{{#vardefine:root|{{#titleparts:{{FULLPAGENAME}}|1}}
}}{{#vardefine:path|{{#if:{{#titleparts:{{PAGENAME}}|-1}}|{{#titleparts:{{PAGENAME}}||2}}}}
}}{{#vardefine:path|{{#if:{{#titleparts:{{PAGENAME}}|-1}}|{{#titleparts:{{PAGENAME}}||2}}}}
-
}}{{#if:{{#var:path}}
+
}}{{#vardefine:main|{{#if:{{{master page|}}}
-
|{{#vardefine:main|{{#if:{{{master page|}}}
+
|{{{master page}}}
-
  |{{{master page}}}
+
|{{#if:{{#var:path}}
   |{{#if:{{#show:{{#var:root}}|?docinfo master page#}}
   |{{#if:{{#show:{{#var:root}}|?docinfo master page#}}
   |{{#show:{{#var:root}}|?docinfo master page#}}/{{#var:path}}
   |{{#show:{{#var:root}}|?docinfo master page#}}/{{#var:path}}
   }}
   }}
   }}
   }}
-
  }}{{#vardefine:stat|{{#if:{{{status|}}}  |{{{status}}}  |{{#show:{{#var:root}}|?docinfo status}}}}
+
  }}
 +
}}{{#ifeq:{{#var:main}}|{{FULLPAGENAME}}
 +
|{{#vardefine:main|}}
 +
|
 +
}}{{#if:{{#var:path}}
 +
|{{  #vardefine:stat|{{#if:{{{status|}}}  |{{{status}}}  |{{#show:{{#var:root}}|?docinfo status}}}}
  }}{{#vardefine:prog|{{#if:{{{progress|}}}|{{{progress}}}|{{#show:{{#var:root}}|?docinfo progress}}}}
  }}{{#vardefine:prog|{{#if:{{{progress|}}}|{{{progress}}}|{{#show:{{#var:root}}|?docinfo progress}}}}
  }}{{#vardefine:prio|{{#if:{{{priority|}}}|{{{priority}}}|{{#show:{{#var:root}}|?docinfo priority}}}}
  }}{{#vardefine:prio|{{#if:{{{priority|}}}|{{{priority}}}|{{#show:{{#var:root}}|?docinfo priority}}}}
Line 15: Line 24:
  }}{{#vardefine:edit|{{#if:{{{editor|}}}  |{{{editor}}}  |{{#show:{{#var:root}}|format=list|?docinfo editor#}}}}
  }}{{#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:supp|{{#if:{{{support|}}} |{{{support}}} |{{#show:{{#var:root}}|format=list|?docinfo support#}}}}
-
  }}{{#vardefine:lang|{{#if:{{{lang|}}}    |{{{lang}}}    |{{#show:{{{root}}}|?docinfo language}}}}
+
  }}{{#vardefine:lang|{{#if:{{{lang|}}}    |{{{lang}}}    |{{#show:{{#var:root}}|?docinfo language}}}}
  }}
  }}
-
|{{  #vardefine:main|{{{master page|}}}
+
|{{  #vardefine:stat|{{{status|}}}
-
}}{{#vardefine:stat|{{{status|}}}
+
  }}{{#vardefine:prog|{{{progress|}}}
  }}{{#vardefine:prog|{{{progress|}}}
  }}{{#vardefine:prio|{{{priority|}}}
  }}{{#vardefine:prio|{{{priority|}}}
Line 29: Line 37:
}}{{#if:{{#var:main}}
}}{{#if:{{#var:main}}
|{{  #vardefine:mrev|{{{master rev|}}}
|{{  #vardefine:mrev|{{{master rev|}}}
-
  }}{{#vardefine:head|{{#if:{{{heading|}}}|{{{heading}}}|{{#show:{{{master page}}}|?book heading}}}}
+
  }}{{#vardefine:head|{{#if:{{{heading|}}}|{{{heading}}}|{{#show:{{#var:main}}|?book heading}}}}
-
  }}{{#vardefine:titl|{{#if:{{{title|}}}  |{{{title}}}  |{{#show:{{{master page}}}|?book title}}}}
+
  }}{{#vardefine:titl|{{#if:{{{title|}}}  |{{{title}}}  |{{#show:{{#var:main}}|?book title}}}}
-
  }}{{#vardefine:next|{{#if:{{{next|}}}  |{{{next}}}  |{{#show:{{{master page}}}|?book next}}}}
+
  }}{{#vardefine:next|{{#if:{{{next|}}}  |{{{next}}}  |{{#show:{{#var:main}}|?book next}}}}
-
  }}{{#vardefine:desc|{{#if:{{{desc|}}}  |{{{desc}}}  |{{#show:{{{master page}}}|?description}}}}
+
  }}{{#vardefine:desc|{{#if:{{{desc|}}}  |{{{desc}}}  |{{#show:{{#var:main}}|?description}}}}
  }}
  }}
|{{  #vardefine:head|{{{heading|}}}
|{{  #vardefine:head|{{{heading|}}}
Line 53: Line 61:
|{{Book/Link|..|{{message|Up|dict=nav|nocat}}}} &#124;&nbsp;
|{{Book/Link|..|{{message|Up|dict=nav|nocat}}}} &#124;&nbsp;
}}{{#if:{{#var:next}}
}}{{#if:{{#var:next}}
-
|{{Book/Link|{{#rel2abs:{{#var:next}}|{{FULLPAGENAME}}}}|{{message|Next|dict=nav|nocat}}}}
+
|{{Book/Link|{{#var:next}}|{{message|Next|dict=nav|nocat}}}}
}}</span>
}}</span>
</div>
</div>
Line 59: Line 67:
<div id="bookFooterNavSrc" 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
+
      --> 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}}
  |{{#var:prev}}
-
  |{{message|Prev|dict=nav|nocat}}
+
  |&lt;&nbsp;{{message|Prev|dict=nav|nocat}}
  }}</span>
  }}</span>
-
|style="width:30%;vertical-align:bottom;text-align:center"|<span class="subpages">{{Book/Link
+
|style="vertical-align:bottom;<!--
 +
    --> text-align:center;<!--
 +
    -->"|<span class="subpages">{{Book/Link
  |..
  |..
  |{{message|Up|dict=nav|nocat}}
  |{{message|Up|dict=nav|nocat}}
  }}</span>
  }}</span>
-
|style="width:35%;vertical-align:bottom;text-align:right" |<span class="subpages">{{#if:{{#var:next}}
+
|style="vertical-align:bottom;<!--
-
|{{Book/Link
+
    --> text-align:right;<!--
-
  |{{#rel2abs:{{#var:next}}|{{FULLPAGENAME}}}}
+
    -->"|<span class="subpages">{{Book/Link
-
  |{{message|Next|dict=nav|nocat}}
+
|{{#var:next}}
-
  }}
+
|{{message|Next|dict=nav|nocat}}&nbsp;&gt;
  }}</span>
  }}</span>
|-
|-
-
|style="width:35%;vertical-align:bottom;text-align:left" |<span class="subpages">{{Book/Link
+
|style="width:40%;<!--
-
|{{#var:prev}}
+
    --> vertical-align:bottom;<!--
-
}}</span>
+
    --> text-align:left;<!--
-
|style="width:30%;vertical-align:bottom;text-align:center"|<span class="subpages">{{Book/Link
+
    --> white-space:nowrap;<!--
-
|{{#var:root}}
+
    -->"|<span class="subpages">{{Book/Link|{{#var:prev}}|show=all}}</span>
-
}}</span>
+
|style="width:20%;<!--
-
|style="width:35%;vertical-align:bottom;text-align:right" |<span class="subpages">{{#if:{{#var:next}}
+
    --> vertical-align:bottom;<!--
-
|{{Book/Link
+
    --> text-align:center;<!--
-
  |{{#rel2abs:{{#var:next}}|{{FULLPAGENAME}}}}
+
    --> white-space:nowrap;<!--
-
  }}
+
    -->"|<span class="subpages">{{Book/Link|{{#var:root}}|show=all}}</span>
-
}}</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}}}}
{{languages|{{#var:main}}}}
 +
{{documentation debug}}
</div>
</div>
{{DISPLAYTITLE:{{#if:{{#var:head}}|{{#var:head}}&nbsp;}}{{#var:titl}}
{{DISPLAYTITLE:{{#if:{{#var:head}}|{{#var:head}}&nbsp;}}{{#var:titl}}
Line 106: Line 129:
}}{{#if:{{#var:next}}|{{#set:
}}{{#if:{{#var:next}}|{{#set:
  |book next  ={{#var:next}}
  |book next  ={{#var:next}}
-
  |book chain ={{#rel2abs:{{#var:next}}|{{FULLPAGENAME}}}}
+
  |book chain ={{#rel2abs:{{#replace:{{#var:next}}|~|{{#var:root}}}}|{{FULLPAGENAME}}}}
  }}
  }}
}}[[Category:Books|{{PAGENAME}}]]</includeonly><noinclude>
}}[[Category:Books|{{PAGENAME}}]]</includeonly><noinclude>
{{documentation includeonly}}
{{documentation includeonly}}
-
{{documentation}}
+
</noinclude></onlyinclude>
-
</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