Template:BubbleBox: Difference between revisions

From Paw Borough Wiki
(:))
 
(→‎Parameters: TemplateData extension)
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:


=== Parameters ===
=== Parameters ===
{|
<templatedata>
|-
{
|<code>content</code>||Unnamed.||The content of the container, or "open" to leave the container as an unterminated <nowiki><div></nowiki> element.
"params": {
|- style="vertical-align: top;"
"content": {
|<code>border</code>||Optional.||An RGB triplet to use as the border color of the container. The default color is {{SiteColor|Generic}}, defined in [[Template:SiteColor|SiteColor]] as "Generic".
"description": "The content of the container, or \"open\" to leave the container as an unterminated <div> element.",
|- style="vertical-align: top;"
"suggestedvalues": [
|<code>background</code>||Optional.||A CSS color value to use as the background for the content portion of the container, or "bubbles" for the site-standard bubble background. The default color is rgba(<code>border</code>, 0.25).
"open"
|- style="vertical-align: top;"
]
|<code>style</code>||Optional.||A CSS property list to apply to the container.
},
|- style="vertical-align: top;"
"border": {
|<code>collapsed</code>||Optional.||If present, the container becomes collapsible and two nested, unterminated <nowiki><div></nowiki> elements. <code>content</code> will appear before the collapsible region. Must be one of the following:
"description": "An RGB triplet to use as the border color of the container. The default color is 192, 192, 192, defined in Template:SiteColor as \"Generic\".",
*"true" - The collapsible region is collapsed by default.
"default": "rgb(192, 192, 192)"
*"false" - The collapsible region is expanded by default.
},
|- style="vertical-align: top;"
"background": {
|<code>tags</code>||Optional.||If present, the given tag names will be added to the element. This is useful only for back-end JavaScript purposes.
"description": "A CSS color value to use as the background for the content portion of the container, or \"bubbles\" for the site-standard bubble background. The default color is rgba([border], 0.25).",
|}
"default": "rgba([border], 0.25)."
},
"style": {
"description": "A CSS property list to apply to the container."
},
"collapsed": {
"description": "If present, the container becomes collapsible and two nested, unterminated <div> elements. [content] parameter will appear before the collapsible region. Must be one of the following:\n\"true\" - The collapsible region is collapsed by default.\n\"false\" - The collapsible region is expanded by default.",
"suggestedvalues": [
"true",
"false"
]
},
"tags": {
"description": "If present, the given tag names will be added to the element. This is useful only for back-end JavaScript purposes."
}
}
}
</templatedata>


=== Example ===
=== Example ===


==== Markup ====
==== Markup ====
  <nowiki>{{BubbleBox|background=rgba({{SiteColor|Splatoon}}, 0.25)|border={{SiteColor|Splatoon}}|Sample text 1}}
  <nowiki>{{BubbleBox|background=rgba({{SiteColor|Abyssal}}, 0.25)|border={{SiteColor|Sol}}|Sample text 1}}
{{BubbleBox|Sample text 2}}
{{BubbleBox|Sample text 2}}
{{BubbleBox|border={{SiteColor|Splatoon 2}}|Sample text 3}}
{{BubbleBox|border={{SiteColor|Metropolis}}|Sample text 3}}
{{BubbleBox|open|background=stripes|border={{SiteColor|NIWA}}}}Sample text 4</div>
{{BubbleBox|open|background=stripes|border={{SiteColor|Luna}}}}Sample text 4</div>
{{BubbleBox|background=bubbles|collapsed=false|border=40,80,120|Static content}}Collapsible content</div></div>
{{BubbleBox|background=bubbles|collapsed=false|border=40,80,120|Static content}}Collapsible content</div></div>
</nowiki>
</nowiki>


==== Output ====
==== Output ====
{{BubbleBox|background=rgba({{SiteColor|Splatoon}}, 0.25)|border={{SiteColor|Splatoon}}|Sample text 1}}
{{BubbleBox|background=rgba({{SiteColor|Abyssal}}, 0.25)|border={{SiteColor|Sol}}|Sample text 1}}
{{BubbleBox|Sample text 2}}
{{BubbleBox|Sample text 2}}
{{BubbleBox|border={{SiteColor|Splatoon 2}}|Sample text 3}}
{{BubbleBox|border={{SiteColor|Metropolis}}|Sample text 3}}
{{BubbleBox|background=stripes|border={{SiteColor|NIWA}}|open}}Sample text 4</div>
{{BubbleBox|open|background=stripes|border={{SiteColor|Luna}}}}Sample text 4</div>
{{BubbleBox|background=bubbles|collapsed=false|border=40,80,120|Static content}}Collapsible content</div></div>
{{BubbleBox|background=bubbles|collapsed=false|border=40,80,120|Static content}}Collapsible content</div></div>
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 18:28, 12 April 2026

Produces a site-standard content container.

Parameters

No description.

[Edit template data]

Template parameters

ParameterDescriptionTypeStatus
contentcontent

The content of the container, or "open" to leave the container as an unterminated <div> element.

Suggested values
open
Unknownoptional
borderborder

An RGB triplet to use as the border color of the container. The default color is 192, 192, 192, defined in Template:SiteColor as "Generic".

Default
rgb(192, 192, 192)
Unknownoptional
backgroundbackground

A CSS color value to use as the background for the content portion of the container, or "bubbles" for the site-standard bubble background. The default color is rgba([border], 0.25).

Default
rgba([border], 0.25).
Unknownoptional
stylestyle

A CSS property list to apply to the container.

Unknownoptional
collapsedcollapsed

If present, the container becomes collapsible and two nested, unterminated <div> elements. [content] parameter will appear before the collapsible region. Must be one of the following:

"true" - The collapsible region is collapsed by default.

"false" - The collapsible region is expanded by default.

Suggested values
true false
Unknownoptional
tagstags

If present, the given tag names will be added to the element. This is useful only for back-end JavaScript purposes.

Unknownoptional

Example

Markup

{{BubbleBox|background=rgba({{SiteColor|Abyssal}}, 0.25)|border={{SiteColor|Sol}}|Sample text 1}}
{{BubbleBox|Sample text 2}}
{{BubbleBox|border={{SiteColor|Metropolis}}|Sample text 3}}
{{BubbleBox|open|background=stripes|border={{SiteColor|Luna}}}}Sample text 4</div>
{{BubbleBox|background=bubbles|collapsed=false|border=40,80,120|Static content}}Collapsible content</div></div>

Output

Sample text 1
Sample text 2
Sample text 3
Sample text 4
Static content
Collapsible content