Template:Alert: Difference between revisions

Content deleted Content added
Created page with "<noinclude> Examples: === Traditional === ==== Source ==== <pre><nowiki> {{Alert |type=traditional |content = an alert |content bold = This is |icon = info-circle |icon-type = fad }} </nowiki></pre> ==== Result ==== {{Alert |type=traditional |content = an alert |content bold = This is |icon = info-circle |icon-type = fad }} === Modern with Badge === ==== Source ==== <pre><nowiki> {{Alert |type=modern |content = an alert |content bold = This is |icon = info-circle |icon-t..."
 
No edit summary
Line 190: Line 190:
<p>{{#if:{{{content bold|}}}|'''{{{content bold}}}'''|}} {{{content|}}}</p>
<p>{{#if:{{{content bold|}}}|'''{{{content bold}}}'''|}} {{{content|}}}</p>
</div>
</div>
|top border = <div class="not-prose {{{bg-color|bg-teal-100}}} border-t-4 {{{border-color|border-teal-500}}} rounded-b {{{text-color|text-teal-900}}} px-4 py-3 shadow-md" role="alert"><div class="flex"><div class="py-1">{{#if:{{{icon|}}}|{{i|{{{icon}}}|{{{icon-type|fal}}}|fill-current h-6 w-6 text-teal-500 mr-4}} }}</div>
|top border = <div class="not-prose {{{bg-color|bg-teal-100}}} border-t-4 {{{border-color|border-teal-500}}} rounded-b {{{text-color|text-teal-900}}} px-4 py-3 shadow-md" role="alert"><div class="flex"><div class="py-1">{{#if:{{{icon|}}}|{{i|{{{icon}}}|{{{icon-type|fal}}}|fa-xl fill-current h-6 w-6 text-teal-500 mr-4}} }}</div>
<div>
<div>
<p class="font-bold">{{{content bold|}}}</p>
<p class="font-bold">{{{content bold|}}}</p>
Line 203: Line 203:
|
|
}}</includeonly>
}}</includeonly>
<noinclude>
<templatedata>
{
"params": {
"type": {
"type": "string",
"suggestedvalues": [
"traditional",
"titled",
"solid",
"modern",
"left border",
"top border",
"banner"
],
"default": "traditional",
"suggested": true
},
"bg-color": {
"label": "Background color",
"type": "string",
"suggestedvalues": [
"bg-light-azure",
"bg-light-purple",
"bg-light-magenta"
],
"suggested": true
},
"border-color": {
"label": "Border color",
"type": "string",
"suggestedvalues": [
"border-fox-purple",
"border-fox-azure",
"bg-fox-magenta"
],
"suggested": true
},
"text-color": {
"label": "Text color",
"type": "string",
"suggestedvalues": [
"text-fox-purple",
"text-fox-azure",
"text-fox-magenta"
]
},
"icon": {
"label": "Icon",
"description": "Font Awesome icon name",
"type": "string"
},
"icon-type": {
"label": "Icon type",
"description": "Font Awesome icon weight",
"type": "string",
"suggestedvalues": [
"fa-solid",
"fa-regular",
"fa-light",
"fa-thin",
"fa-duotone"
],
"suggested": true
},
"content bold": {
"label": "Bold content",
"type": "line",
"suggested": true
},
"content": {
"label": "Content",
"type": "line",
"suggested": true
},
"link": {
"label": "Link to page",
"type": "wiki-page-name",
"suggested": true
},
"direction": {
"label": "Direction",
"description": "click if RTL",
"suggestedvalues": [
"rtl"
]
}
},
"description": "Template for text alerts and banners",
"paramOrder": [
"content",
"content bold",
"type",
"bg-color",
"border-color",
"text-color",
"icon",
"icon-type",
"link",
"direction"
],
"format": "inline"
}
</templatedata>
</noinclude>

Revision as of 01:15, 2 May 2025

Examples:

Traditional

Source

{{Alert
|type=traditional
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
}}

Result

Modern with Badge

Source

{{Alert
|type=modern
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
|link=https://example.com
}}

Result

Left Accent Border

Source

{{Alert
|type=left border
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
|link=https://example.com
}}

Result

Titled

Source

{{Alert
|type=titled
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
|link=https://example.com
}}

Result


Solid

Source

{{Alert
|type=solid
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
|link=https://example.com
}}

Result


Top Accent Border

Source

{{Alert
|type=top border
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
|link=https://example.com
}}

Result


Source

{{Alert
|type=banner
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
|link=https://example.com
}}

Result


Titled

Source

{{Alert
|type=Titled
|content = an alert
|content bold = This is
|icon = info-circle
|icon-type = fad
|link=https://example.com
}}

Result

Template for text alerts and banners

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Contentcontent

no description

Linesuggested
Bold contentcontent bold

no description

Linesuggested
typetype

no description

Suggested values
traditional titled solid modern left border top border banner
Default
traditional
Stringsuggested
Background colorbg-color

no description

Suggested values
bg-light-azure bg-light-purple bg-light-magenta
Stringsuggested
Border colorborder-color

no description

Suggested values
border-fox-purple border-fox-azure bg-fox-magenta
Stringsuggested
Text colortext-color

no description

Suggested values
text-fox-purple text-fox-azure text-fox-magenta
Stringoptional
Iconicon

Font Awesome icon name

Stringoptional
Icon typeicon-type

Font Awesome icon weight

Suggested values
fa-solid fa-regular fa-light fa-thin fa-duotone
Stringsuggested
Link to pagelink

no description

Page namesuggested
Directiondirection

click if RTL

Suggested values
rtl
Unknownoptional