Template:Notice: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 7: | Line 7: | ||
<div style="position: relative;"><!-- | <div style="position: relative;"><!-- | ||
-->{{#if:{{{dismiss|}}}|{{#ifeq:{{{dismiss}}}|no||<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}|<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}<!-- | -->{{#if:{{{dismiss|}}}|{{#ifeq:{{{dismiss}}}|no||<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}|<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{header|}}}|<div class="notice-main-text" style="font-weight:bold;">{{{header}}}</div>}}<!-- | ||
--><div class="{{#if:{{{ | --><div class="{{#if:{{{header|}}}|hide-for-multinotice|notice-main-text}}" style="white-space: normal;">{{{text}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
--></div> | --></div> | ||
| Line 16: | Line 16: | ||
Change default background color to #EAEBEF if {{{color}}} is not passed. | Change default background color to #EAEBEF if {{{color}}} is not passed. | ||
{{notice|width=50%| | {{notice|width=50%|header=Header|text=Test|color=pink|align=left|clear=yes}} | ||
== Parameters == | == Parameters == | ||
{{{style}}} - allows the user to set various style elements of the notice box, like background color | {{{style}}} - allows the user to set various style elements of the notice box, like background color | ||
| Line 31: | Line 31: | ||
<code><nowiki> | <code><nowiki> | ||
{{notice|style=background-color:#CCA; | {{notice|style=background-color:#CCA; | ||
| | |header=This is the bold title of the box! | ||
| | |text=This is the regular text with more detail | ||
}} | }} | ||
</nowiki></code> | </nowiki></code> | ||
| Line 38: | Line 38: | ||
produces this when the template is used: | produces this when the template is used: | ||
{{notice|style=background-color:#CCA; | {{notice|style=background-color:#CCA; | ||
| | |header=This is the bold title of the box! | ||
| | |text=This is the regular text with more detail | ||
}} | }} | ||
Here's another example, this time without the bold line at the top. | Here's another example, this time without the bold line at the top. | ||
| Line 46: | Line 46: | ||
<code><nowiki> | <code><nowiki> | ||
{{notice|style=background-color:#FAA; | {{notice|style=background-color:#FAA; | ||
| | |text=This notice doesn't have a bold title | ||
}} | }} | ||
</nowiki></code> | </nowiki></code> | ||
{{notice|style=background-color:#FAA; | {{notice|style=background-color:#FAA; | ||
| | |text=This notice doesn't have a bold title | ||
|dismiss=no | |dismiss=no | ||
}} | }} | ||
| Line 58: | Line 58: | ||
{{notice | {{notice | ||
| | |header=This is a test | ||
| | |text=this is also a test | ||
|color=#bdcca1 | |color=#bdcca1 | ||
|align=left | |align=left | ||
Revision as of 02:18, 24 April 2025
The Notice template is a parent template that helps build Notice Templates. This template should never be used in its raw form on an article, but instead should be used to create new templates.
Change default background color to #EAEBEF if {{{color}}} is not passed.
Parameters
{{{style}}} - allows the user to set various style elements of the notice box, like background color
{{{b}}} - optional parameter that creates a bolded title for the notice box
{{{1}}} - the regular text in the notice box
Examples
Here is one example of a potential notice box.
This code on the template page
{{notice|style=background-color:#CCA;
|header=This is the bold title of the box!
|text=This is the regular text with more detail
}}
produces this when the template is used:
Here's another example, this time without the bold line at the top.
This code on the template page
{{notice|style=background-color:#FAA;
|text=This notice doesn't have a bold title
}}
- Use
|clear=yesif the notice is interfering with other elements.
Derived Templates
- Template:Partial (transclusion) (← links | edit)
- Template:Complete (transclusion) (← links | edit)
- Template:Notice (transclusion) (← links | edit)
- Template:Stub (transclusion) (← links | edit)
- Template:Copyright (transclusion) (← links | edit)
- Template:Delete (transclusion) (← links | edit)
- Template:Spoiler (transclusion) (← links | edit)
- Template:Claim (transclusion) (← links | edit)
- Template:Theory (transclusion) (← links | edit)
- Template:Rename (transclusion) (← links | edit)
- Template:Test/A (transclusion) (← links | edit)
- Template:Editlock (← links | edit)
- Template:Update (transclusion) (← links | edit)