Template:Heading/doc View history

(Created doc page for template)
 
(renamed category)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{doc subpage}}
{{doc subpage}}
== Usage ==
== Usage ==
This template enables a selectable number of "=" to be displayed before and after a text string creating a heading. This enables headings to be dynamic especially in transcludable pages where the headings may be at different levels depending upon where it is placed.
This template enables a selectable number of "=" to be displayed before and after a text string creating a heading. This enables headings to be variable especially in transcludable pages where the headings may be at different levels depending upon where it is placed.


== Parameters ==
== Parameters ==
Line 7: Line 7:


== Example ==
== Example ==
=== Base page content ===
When setting up the base page or template use the following:
<pre>
<pre>
{{Heading|3|A level three heading}}
{{Heading|{{{1|3}}}|Level three heading on its own page}}
{{Heading|{{#expr:{{{1|3}}}+1}}|Level four heading on its own page}}
</pre>
</pre>


produces:
produces:
<pre>
<pre>
=== A level three heading ===
=== Level three heading on its own page ===
==== Level four heading on its own page ====
</pre>
</pre>


=== The calling page ===
When calling the base page or template into another page use the following:
<pre>
{{Base Page|4}}
</pre>
produces:
<pre>
==== Level three heading on its own page ====
===== Level four heading on its own page =====
</pre>
Notice the level now starts at level 4 and increments from there when the page is transcluded into another page


<includeonly>
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Text Formatting Templates]]
[[Category:Text formatting templates]]


<!-- ADD INTERWIKIS BELOW THIS LINE -->
<!-- ADD INTERWIKIS BELOW THIS LINE -->


</includeonly>
</includeonly>

Latest revision as of 22:09, 3 August 2014

This is a documentation subpage for Template:Heading.
It contains usage information, categories and other content that is not part of the original template page.

Usage

This template enables a selectable number of "=" to be displayed before and after a text string creating a heading. This enables headings to be variable especially in transcludable pages where the headings may be at different levels depending upon where it is placed.

Parameters

There are two required parameters. The first is the number of equal signs desired indicating the heading level. The second is the heading text.

Example

Base page content

When setting up the base page or template use the following:

{{Heading|{{{1|3}}}|Level three heading on its own page}}
{{Heading|{{#expr:{{{1|3}}}+1}}|Level four heading on its own page}}

produces:

=== Level three heading on its own page ===
==== Level four heading on its own page ====

The calling page

When calling the base page or template into another page use the following:

{{Base Page|4}}

produces:

==== Level three heading on its own page ====
===== Level four heading on its own page =====

Notice the level now starts at level 4 and increments from there when the page is transcluded into another page