Mr. Johnson (talk | contribs) m (Mr. Johnson moved page Template:Box/Documentation to Template:Redbox/Documentation without leaving a redirect) |
Mr. Johnson (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>[[Category:Box Template]]</includeonly> | <includeonly>[[Category:Box Template]]</includeonly> | ||
{{Template| | {{Template|Redbox}} is used to create styled text and image boxes. | ||
==Usage== | ==Usage== | ||
It accepts one {{Parameter|mandatory|string}} and one {{Parameter|optional|string}}. | It accepts one {{Parameter|mandatory|string}} and one {{Parameter|optional|string}}. | ||
* {{Code|1}} is the name of the article and the header for the text box. | * {{Code|1}} is the name of the article and the header for the text box. | ||
* {{Code|2}}, if supplied, is the contents of the text box. If not supplied, the contents is transcluded from a subpage of the article, using the header as the subpage name. It also uses {{Template|Edit}} to adds a link to directly edit the subpage. | * {{Code|2}}, if supplied, is the contents of the text box. If not supplied, the contents is transcluded from a subpage of the article, using the header as the subpage name. <!--It also uses {{Template|Edit}} to adds a link to directly edit the subpage.--> | ||
It also accepts two {{Parameter|optional|named}}s: | It also accepts two {{Parameter|optional|named}}s: | ||
* {{Code|width}} accepts {{Code|Xpx}} or {{Code|X%}}, and controls the width of the box. If undefined, the box has {{Code|10%}} margins left and right. | * {{Code|width}} accepts {{Code|Xpx}} or {{Code|X%}}, and controls the width of the box. If undefined, the box has {{Code|10%}} margins left and right. | ||
* {{Code|float}} accepts {{Code|left}}, {{Code|right}}, or {{code|clear}}. | * {{Code|float}} accepts {{Code|left}}, {{Code|right}}, or {{code|clear}}. | ||
** If {{Code|left}} or {{Code|right}}, the box is floated to the selected side of the screen and the margins and padding are setup coorespondingly. | ** If {{Code|left}} or {{Code|right}}, the box is floated to the selected side of the screen and the margins and padding are setup coorespondingly. | ||
==Return== | ==Return== | ||
{{Code|<nowiki>{{{ | {{Code|<nowiki>{{{Redbox|Lorem Ipsum|{{Lorem Ipsum|2}}}}</nowiki>}} returns: {{Return| {{Redbox|Lorem Ipsum|{{Lorem Ipsum|2}}}}}} | ||
{{Code|<nowiki>{{ | {{Code|<nowiki>{{Redbox|Sample}}</nowiki>}} returns: {{Return|{{Redbox|Sample}}}} | ||
No examples are included for {{code|float}}, as they don't appear correctly inside {{Template|Return}}. | No examples are included for {{code|float}}, as they don't appear correctly inside {{Template|Return}}. |
Latest revision as of 06:24, 19 November 2023
Template:Redbox
is used to create styled text and image boxes.
Usage
It accepts one mandatory string parameter and one optional string parameter.
1
is the name of the article and the header for the text box.2
, if supplied, is the contents of the text box. If not supplied, the contents is transcluded from a subpage of the article, using the header as the subpage name.
It also accepts two optional named parameters:
width
acceptsXpx
orX%
, and controls the width of the box. If undefined, the box has10%
margins left and right.float
acceptsleft
,right
, orclear
.- If
left
orright
, the box is floated to the selected side of the screen and the margins and padding are setup coorespondingly.
- If
Return
{{{Redbox|Lorem Ipsum|{{Lorem Ipsum|2}}}}
returns:
Lorem Ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis metus nunc. Fusce est libero, interdum vel iaculis et, blandit quis odio. Integer ac magna nunc. In quis libero purus. Praesent mattis eget justo in efficitur. Aenean tempor congue dictum. Mauris hendrerit nunc a auctor dictum.
{{Redbox|Sample}}
returns:
Sample
This page intentionally left blank... or something.
No examples are included for float
, as they don't appear correctly inside Template:Return
.