Template:Part: Difference between revisions

From Shifti
Jump to navigation Jump to search
extend the template to allow for omission of the "Number" parameter if the "Name" parameter is included.
mNo edit summary
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifeq: {{{name| }}} | |
<includeonly>
  === Part {{{number}}} === |
{{#vardefine:name|{{{name| }}}}}
  {{#ifeq: {{{number| }}} | |
{{#vardefine:number|{{{number| }}}}}
    === {{{name}}} === |
{{#vardefine:text|{{#ifeq:{{#var:name}}| |{{#ifeq:{{#var:number}}| |<hr/>|Part {{{number}}}}}|{{#ifeq:{{#var:number}}| |{{{name}}}|Part {{{number}}}: {{{name}}}}}}}}}
    === Part {{{number}}}: {{{name}}} ===  
{{#ifeq:{{NAMESPACE}}|Template|<nowiki>{{part|name=section name|number=section number|seper=separator template type}}</nowiki>|{{#ifeq:{{{seper| }}}| |{{#ifeq:{{#var:text}}|<hr/>|===<hr/>===|==={{#var:text}}===}}|{{#ifeq:{{{seper}}}|hr|==={{Separator}}===
  }}
==={{#var:text}}===|==={{Separator|{{{seper}}}|{{#var:text}}}}===}}}}}}</includeonly>
}}
<br/>
<noinclude>
<noinclude>
Usage: <nowiki>{{part|name=Name|number=Number}}, though you can omit the "Name" or "Number" parameter - The template will fail if you omit both.</nowiki>
__NOTOC__
;Usage&#58;: &#123;&#123;part|name=Name|number=Number|seper=type&#125;&#125;
:: <span style="font-size: 14pt;>You '''''can''''' omit the parameters (as shown), but this gives you a "usage error" for the heading.</span>
:: (Four or more headings automatically creates a Table of Contents.)
:: The "seper" parameter refers to one of the types of separators that can take a text argument. See [[Help:Templates]] and [[Template:Separator]] for more information. Use "seper=hr" if you want a horizontal rule type separator instead of one of the graphical ones.
:: See [[User:ShadowWolf/Test_Page]] for examples.
<span style="font-size: 150%; font-weight: 132%;">WARNING: This Template Has Been Deprecated!</span>
</noinclude>
</noinclude>

Latest revision as of 03:07, 5 August 2007


Usage:
{{part|name=Name|number=Number|seper=type}}
You can omit the parameters (as shown), but this gives you a "usage error" for the heading.
(Four or more headings automatically creates a Table of Contents.)
The "seper" parameter refers to one of the types of separators that can take a text argument. See Help:Templates and Template:Separator for more information. Use "seper=hr" if you want a horizontal rule type separator instead of one of the graphical ones.
See User:ShadowWolf/Test_Page for examples.

WARNING: This Template Has Been Deprecated!