Template:Notice: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
{{#if: {{{clear|}}} | <div style="clear: both;"></div> }} | {{#if: {{{clear|}}} | <div style="clear: both;"></div> }} | ||
<div {{#if:{{{id|}}}|id="{{{id}}}"}} class="notice hide-for-print {{{class|curved}}}" style="width: {{#if:{{{width|}}}{{{width}}}|{{{width}}}|50%}}; | <div {{#if:{{{id|}}}|id="{{{id}}}"}} class="notice hide-for-print {{{class|curved}}} {{#if:{{{dismiss|}}}|{{#ifeq:{{{dismiss}}}|no||dismissible-notice}}|dismissible-notice}}" style="width: {{#if:{{{width|}}}{{{width}}}|{{{width}}}|50%}}; | ||
{{#switch:{{{align|center}}}|left=margin: 0.3em 0.3em 0.3em 0;|right=margin: 0.3em 0 0.3em auto;|#default=margin: 0.3em auto;}}; | |||
padding: 0.5em; text-align: center; font-size: {{{font-size|1em}}}; {{{style}}}; | |||
{{#if: {{{color|}}} | background-color: {{{color}}}; {{#if: {{{border|}}} | border: {{{border}}}; }} | border: 1px solid black; }} | |||
"> | |||
<div style="position: relative;"> | |||
{{#if:{{{dismiss|}}}|{{#ifeq:{{{dismiss}}}|no||<div class="dismiss-button" style="position: absolute; top: -12px; right: -3px; cursor: pointer; padding: 5px;">×</div>}}| <div class="dismiss-button" style="position: absolute; top: -12px; right: -3px; cursor: pointer; padding: 5px;">×</div>}} | |||
{{#if:{{{b|}}}|<div class="notice-main-text" style="font-weight:bold;">{{{b}}}</div>}} | |||
<div class="{{#if:{{{b|}}}|hide-for-multinotice|notice-main-text}}" style="white-space: normal;">{{{1}}}</div> | |||
</div> | |||
</div> | </div> | ||
</includeonly><noinclude> | </includeonly><noinclude> | ||
| Line 49: | Line 56: | ||
:'''Use <code>clear=yes</code> if the notice is interfering with other elements. | :'''Use <code>clear=yes</code> if the notice is interfering with other elements. | ||
{{test | |||
|b=This is a test | |||
|1=this is also a test | |||
|color=#bdcca1 | |||
|align=left | |||
|width=100% | |||
}}{{example | |||
|name=Beth Brower | |||
|image=Beth Brower-2.jpg | |||
|caption=Our Undaunted Author | |||
|profession=Author, Owner of Cat | |||
|titles=''The Right Honorable Beth'' | |||
}} | |||
Revision as of 23:45, 25 March 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.
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;
|b=This is the bold title of the box!
|1=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;
|1=This notice doesn't have a bold title
}}
- Use
clear=yesif the notice is interfering with other elements.
| Beth Brower | |
| Our Undaunted Author | |
| Profession | Author, Owner of Cat |
|---|---|
| Titles | The Right Honorable Beth |
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)
