Template:Separator: Difference between revisions

From Shifti
Jump to navigation Jump to search
add a touch of space between the dingbats and text
Actually, no reason not to support custom width for the horizontal rule
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#if:{{{1|}}}|{{#if:{{{2|}}}|<div class="center">[[Image:Separator {{{1}}} left.png|{{{3|100px}}}]]&nbsp;{{{2}}}&nbsp;[[Image:Separator {{{1}}} right.png|{{{3|100px}}}]]</div>|[[Image:Separator {{{1}}}.png|{{{3|200px}}}|center]]}}|<hr/>}}<noinclude>
{{#if:{{{1|}}}|{{#if:{{{2|}}}|<div class="center">[[Image:Separator {{{1}}} left.png|{{{3|100px}}}]]&nbsp;{{{2}}}&nbsp;[[Image:Separator {{{1}}} right.png|{{{3|100px}}}]]</div>|[[Image:Separator {{{1}}}.png|{{{3|200px}}}|center]]}}|<hr style="width:{{{3|33%}}};  text-align: center; margin: 10px auto; height: 4px;" />}}<noinclude>


This template is used for producing separators with fancy dingbat images and text. It has three parameters, all optional. The first parameter defines which dingbat image set to use, the second is the text to insert into the dingbat, and the third can be used to adjust the size of the images away from the default.
Usage:


When used with no parameters whatsoever, the template simply places a horizontal rule.
<pre>{{Separator|<identifier>|Optional text|optional image width}}</pre>
 
This template is used for producing separators with fancy dingbat images and text. It has three parameters. The first parameter defines which dingbat image set to use, the second is the text to insert into the dingbat, and the third can be used to adjust the size of the images away from the default.
 
When no dingbat identifier is given the template simply places a horizontal rule. This is intended as a fallback measure in case the template is used without parameters, it doesn't support the text in this state (though you can specify width if you like - it defaults to 33%).


Dingbat image sets come in threes and must be named with the following pattern:
Dingbat image sets come in threes and must be named with the following pattern:
Line 11: Line 15:
*Separator <identifier> right.png
*Separator <identifier> right.png


Where <identifier> is whatever string is used in this template to select it.
Where <identifier> is an arbitrary string that's the same for all three images in the set.
 
Image width defaults to 200 pixels without text and 100 pixels with text. To override the width without setting text, use a double pipe to provide an "empty" text parameter, like so:
 
<pre>{{Separator|<identifier>||300px}}</pre>
 
The following table provides examples of image sets that are currently available.
 
{{Separator dingbats}}


</noinclude>
</noinclude>

Latest revision as of 01:42, 31 August 2007

{{#if:|{{#if:|

[[Image:Separator {{{1}}} left.png|100px]] {{{2}}} [[Image:Separator {{{1}}} right.png|100px]]

|[[Image:Separator {{{1}}}.png|200px|center]]}}|


}}

Usage:

{{Separator|<identifier>|Optional text|optional image width}}

This template is used for producing separators with fancy dingbat images and text. It has three parameters. The first parameter defines which dingbat image set to use, the second is the text to insert into the dingbat, and the third can be used to adjust the size of the images away from the default.

When no dingbat identifier is given the template simply places a horizontal rule. This is intended as a fallback measure in case the template is used without parameters, it doesn't support the text in this state (though you can specify width if you like - it defaults to 33%).

Dingbat image sets come in threes and must be named with the following pattern:

  • Separator <identifier>.png
  • Separator <identifier> left.png
  • Separator <identifier> right.png

Where <identifier> is an arbitrary string that's the same for all three images in the set.

Image width defaults to 200 pixels without text and 100 pixels with text. To override the width without setting text, use a double pipe to provide an "empty" text parameter, like so:

{{Separator|<identifier>||300px}}

The following table provides examples of image sets that are currently available.

Inter-paragraph divider dingbats
Template code Without text With text
{{Separator|d}} {{#if:|
 {{{2}}} 
|
}}|
}}
{{#if:Text|
 Text 
|
}}|
}}
{{Separator|f}} {{#if:|
 {{{2}}} 
|
}}|
}}
{{#if:Text|
 Text 
|
}}|
}}
{{Separator|j}} {{#if:|
 {{{2}}} 
|
}}|
}}
{{#if:Text|
 Text 
|
}}|
}}
{{Separator|k}} {{#if:|
 {{{2}}} 
|
}}|
}}
{{#if:Text|
 Text 
|
}}|
}}
{{Separator|r}} {{#if:|
 {{{2}}} 
|
}}|
}}
{{#if:Text|
 Text 
|
}}|
}}
{{Separator|x}} {{#if:|
 {{{2}}} 
|
}}|
}}
{{#if:Text|
 Text 
|
}}|
}}
{{Separator|stars}} {{#if:|
 {{{2}}} 
|
}}|
}}
{{#if:Text|
 Text 
|
}}|
}}