Template:Box: Difference between revisions

From AYSO Wiki
Content deleted Content added
No edit summary
m 39 revisions imported: Import changes since February 9, 2026
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly><div class="card with-{{#ifeq:{{{header|}}}|bottom|footer|header}} border border-primary"
<includeonly>
style="grid-column:auto / span 1; width:auto !important; max-width:none !important; min-width:0 !important; float:none !important; box-sizing:border-box; height:340px; position:relative; overflow:hidden; background-position:center; background-repeat:no-repeat; background-size:cover;"
<div class="ayso-box-item"
{{#if:{{{image|}}}|data-background="{{#ifeq:{{{image|}}}|default|/w/extensions/MyWikisLocalConfig/Ayso-logo.png|{{filepath:{{PAGENAME:{{{image|}}}}}}}}}"}}><!--
style="outline:4px dashed magenta; flex:0 0 calc((100% - 48px) / 3); max-width:calc((100% - 48px) / 3); box-sizing:border-box; min-width:0;">
<div class="card with-{{#ifeq:{{{header|}}}|bottom|footer|header}} border border-primary"
style="height:340px; position:relative; overflow:hidden; background-position:center; background-repeat:no-repeat; background-size:cover;"
{{#if:{{{image|}}}|data-background="{{#ifeq:{{{image|}}}|default|/w/extensions/MyWikisLocalConfig/Ayso-logo.png|{{filepath:{{PAGENAME:{{{image|}}}}}}}}}"}}><!--


-->{{#ifeq:{{{header|}}}|bottom||{{#if:{{{target|}}}
-->{{#ifeq:{{{header|}}}|bottom||{{#if:{{{target|}}}
|[[{{{target|}}}|<div class="card-header">{{{title|Title}}}</div>]]
|[[{{{target|}}}|<div class="card-header">{{{title|Title}}}</div>]]
|<div class="card-header">{{{title|Title}}}</div>
|<div class="card-header">{{{title|Title}}}</div>
}}}}<!--
}}}}<!--


-->{{#if:{{{target|}}}
-->{{#if:{{{target|}}}
|[[{{{target|}}}|{{#if: {{{content|}}}
|[[{{{target|}}}|{{#if: {{{content|}}}
|<div class="card-body">
{{{content|}}}</div>
|<div class="card-body"></div>
}}]]
|<div class="card-body">
|<div class="card-body">
{{{content|}}}</div>
{{{content|}}}</div>
|<div class="card-body"></div>
}}<!--
}}]]
|<div class="card-body">
{{{content|}}}</div>
}}<!--


-->{{#ifeq:{{{header|}}}|bottom|{{#if:{{{target|}}}
-->{{#ifeq:{{{header|}}}|bottom|{{#if:{{{target|}}}
|[[{{{target|}}}|<div class="card-footer"
|[[{{{target|}}}|<div class="card-footer"
style="position:absolute; left:0; right:0; bottom:28px; height:48px; display:flex; align-items:center; justify-content:center;">
style="position:absolute; left:0; right:0; bottom:28px; height:48px; display:flex; align-items:center; justify-content:center;">
{{{title|Title}}}
{{{title|Title}}}
</div>]]
</div>]]
|<div class="card-footer"
|<div class="card-footer"
style="position:absolute; left:0; right:0; bottom:28px; height:48px; display:flex; align-items:center; justify-content:center;">
style="position:absolute; left:0; right:0; bottom:28px; height:48px; display:flex; align-items:center; justify-content:center;">
{{{title|Title}}}
{{{title|Title}}}
</div>
</div>
}}|}}
}}|}}
</div></includeonly><noinclude>
</div>
</div>
</includeonly>

<noinclude>
;Usage
;Usage
<pre>
<pre>
Line 46: Line 39:
}}
}}
</pre>
</pre>

;Example
;Example
(Wrapped into [[Template:Boxes]])
(Wrapped into [[Template:Boxes]])
Line 69: Line 61:
}}
}}
}}
}}
<templatedata>
{
"params": {
"header": {
"label": "Box header position",
"description": "Set to \"bottom\" to move header down. Otherwise it will show up at the top.",
"type": "string"
},
"image": {
"label": "Image",
"description": "Name of the uploaded image to be shown as the box background.",
"type": "wiki-file-name"
},
"target": {
"label": "Link target",
"description": "Name of the page to link the box to.",
"type": "wiki-page-name"
},
"title": {
"label": "Box title",
"description": "If not set, falls back to `target`.",
"type": "string"
},
"content": {
"label": "Box content",
"description": "Arbitrary wikitext adapted for use inside templates.",
"type": "content"
}
},
"description": "Creates a box.",
"paramOrder": [
"title",
"header",
"target",
"image",
"content"
]
}
</templatedata>
</noinclude>
</noinclude>

Latest revision as of 02:04, 19 February 2026

Usage
{{Box
|title=
|target=
|header=
|image=
|content=
}}
Example

(Wrapped into Template:Boxes)

Creates a box.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Box titletitle

If not set, falls back to `target`.

Stringoptional
Box header positionheader

Set to "bottom" to move header down. Otherwise it will show up at the top.

Stringoptional
Link targettarget

Name of the page to link the box to.

Page nameoptional
Imageimage

Name of the uploaded image to be shown as the box background.

Fileoptional
Box contentcontent

Arbitrary wikitext adapted for use inside templates.

Contentoptional