Template:Callout: Difference between revisions

From Space Station 14 Wiki
(Created page with "<includeonly><div class="callout"><!-- --><span class="callout-header"></span><!-- --><div class="callout-content"></div><!-- --></div><includeonly><noinclude> {{docs}} <templatedata> { "params": {}, "description": "A template for producing various notices." } </templatedata> </noinclude>")
 
(moved to lua)
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div class="callout"><!--
<includeonly><!--
    --><span class="callout-header"></span><!--
--><templatestyles src="Template:Callout/styles.css" /><!--
    --><div class="callout-content"></div><!--
--></div><includeonly><noinclude>
{{docs}}


-->{{#invoke:Callout|generate_callout}}</includeonly><noinclude>
{{docs|bb=
{{uses lua|Callout}}
{{uses template styles}}
}}
[[Category:Notice templates]]
[[Category:Template starter-kit]]
<templatedata>
<templatedata>
{
{
"params": {},
"params": {
"description": "A template for producing various notices."
"1": {
"label": "Type",
"description": "Type of the callout. Select from the suggested values. Any casing is supported.",
"type": "line",
"suggestedvalues": [
"Info",
"Warning",
"Danger",
"Example",
"Tip"
],
"required": true
},
"2": {
"label": "Content",
"description": "Content of the callout.",
"type": "string",
"required": true
},
"header": {
"label": "Header label",
"description": "Header text of the callout. By default, depends on the type.",
"type": "line",
"suggested": true,
"aliases": [
"h"
]
},
"align": {
"label": "Align",
"description": "Alignment of the callout. When \"Center\" is used, the callout will span almost across the full width of a page. If \"Stacked?\" is enabled, this option is ignored.",
"type": "line",
"suggestedvalues": [
"Left",
"Center",
"Right"
],
"default": "Left",
"suggested": true,
"aliases": [
"a"
]
},
"image": {
"aliases": [
"image1",
"i"
],
"label": "Image",
"description": "An image to add inside the callout at the start.",
"type": "wiki-file-name",
"suggested": true
},
"image2": {
"aliases": [
"i2"
],
"label": "Second image",
"description": "A second image to add inside the callout to the left, after the first one.",
"type": "wiki-file-name",
"suggested": true
},
"wrapper class": {
"label": "Wrapper class",
"description": "Extra class names to assign to the callout wrapper element. Use space to separate multiple classes.",
"type": "line"
},
"stacked": {
"label": "Stacked?",
"description": "If set, the callout will have a predefined constant width, which would be the same for all callouts with this option set. Useful for making notice callouts that \"stack\" on top of each other.",
"type": "boolean",
"autovalue": "0"
}
},
"description": "A template for producing various notices.",
"paramOrder": [
"1",
"2",
"header",
"align",
"image",
"image2",
"stacked",
"wrapper class"
]
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude>

Latest revision as of 11:37, 1 September 2024

Template documentation
view or edit this documentation about template documentation
Uses Lua module
This template uses Lua module:
Uses template styles
This template uses template styles found in:

Examples

Types

Caption text
Type Syntax Result
Info {{Callout|Info|An informative message.}}
Info
An informative message.
Warning {{Callout|Warning|Something to be warned about.}}
Warning
Something to be warned about.
Danger {{Callout|Danger|The clown is closing in.}}
Danger
The clown is closing in.
Tip {{Callout|Tip|When walking over slippery surfaces, hold {{button|Shift}} to slow down and not slip (in most cases).}}
Tip
When walking over slippery surfaces, hold Shift to slow down and not slip (in most cases).
Example {{Callout|Example|An example for something.}}
Example
An example for something.

Header label

{{Callout|Info|header=Notice|Bla-bla-bla, lorem ipsum...}}
or
{{Callout|Info|h=Notice|Bla-bla-bla, lorem ipsum...}}

Notice
Bla-bla-bla, lorem ipsum...

or

Notice
Bla-bla-bla, lorem ipsum...

Alignment

Left

The default.

Center

{{Callout|Info|align=center|Bla-bla-bla, lorem ipsum...}}
or
{{Callout|Info|a=center|Bla-bla-bla, lorem ipsum...}}

Info
Bla-bla-bla, lorem ipsum...

or

Info
Bla-bla-bla, lorem ipsum...

Right

{{Callout|Info|align=right|Bla-bla-bla, lorem ipsum...}}

Info
Bla-bla-bla, lorem ipsum...

Images

{{Callout
| Info
| header = Work in Progress
| align = center
| This page is unfinished.
| image = Wired Frame.png
| image2 = Wrench.png
}}

Work in Progress
This page is unfinished.

Stacked callouts

Sets the callout to a predefined width, making all callouts with the same class appear with the same width.

Callouts will be stacked to the right and will require {{clear}} after to not overflow with the content that goes after.

{{Callout|stacked=1|Info|An informative message. An informative message. An informative message.}}
{{Callout|stacked=1|Info|Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum...}}
{{Clear}}

Info
An informative message. An informative message. An informative message.
Info
Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum... Bla-bla-bla, lorem ipsum...

Wrapper classes

Allows to add custom classes to the wrapper element.

{{Callout|wrapper class=hello|Info|An informative message.}}

Info
An informative message.

A template for producing various notices.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Type1

Type of the callout. Select from the suggested values. Any casing is supported.

Suggested values
Info Warning Danger Example Tip
Linerequired
Content2

Content of the callout.

Stringrequired
Header labelheader h

Header text of the callout. By default, depends on the type.

Linesuggested
Alignalign a

Alignment of the callout. When "Center" is used, the callout will span almost across the full width of a page. If "Stacked?" is enabled, this option is ignored.

Suggested values
Left Center Right
Default
Left
Linesuggested
Imageimage image1 i

An image to add inside the callout at the start.

Filesuggested
Second imageimage2 i2

A second image to add inside the callout to the left, after the first one.

Filesuggested
Stacked?stacked

If set, the callout will have a predefined constant width, which would be the same for all callouts with this option set. Useful for making notice callouts that "stack" on top of each other.

Auto value
0
Booleanoptional
Wrapper classwrapper class

Extra class names to assign to the callout wrapper element. Use space to separate multiple classes.

Lineoptional