Template:Ambox/doc: Difference between revisions

From Sword of Moonlight Wiki
Jump to navigation Jump to search
dlw>Mr Pie 5
No edit summary
 
Created page with "<includeonly><!-- --><div class="ambox {{{class|}}} {{#ifeq:{{lc:{{{tiny|}}}}}|yes|tiny}}"<!-- --> style="--ambox-color: {{{color|}}};"><!-- --><div class="ambox-icon">[[File:{{{icon|Ambox banner content.svg}}}{{!}}{{#ifeq:{{lc:{{{tiny|}}}}}|yes|48x20px|48x48px}}|alt=]]</div><!-- --><div class="ambox-content"><!-- start ambox content -->{{#if: {{{title|}}} | <p class="ambox-title">{{{title}}}</p> }}<!-- --><p class="ambox-text">{{{message|No..."
Line 1: Line 1:
{{#ifeq:{{ROOTPAGENAME}}|Ambox|"Ambox" is an abbreviation for '''A'''rticle '''m'''essage '''box'''. You can use amboxes in articles to indicate something important about the current page, often in the header.|
<includeonly><!--
This '''message template''' is an [[Template:Ambox|article message box]], or '''ambox'''. The documentation below discusses how to use each ambox provided by the wiki.
}}


== Premade amboxes ==
--><div class="ambox {{{class|}}} {{#ifeq:{{lc:{{{tiny|}}}}}|yes|tiny}}"<!--
=== Problem notice amboxes ===
  --> style="--ambox-color: {{{color|}}};"><!--
These amboxes are used temporarily to notify other editors and visitors about a problem with an article. These amboxes support the following parameters:
 
  --><div class="ambox-icon">[[File:{{{icon|Ambox banner content.svg}}}{{!}}{{#ifeq:{{lc:{{{tiny|}}}}}|yes|48x20px|48x48px}}|alt=]]</div><!--
 
  --><div class="ambox-content"><!-- start ambox content
      -->{{#if: {{{title|}}} | <p class="ambox-title">{{{title}}}</p> }}<!--
      --><p class="ambox-text">{{{message|No text provided.}}}{{#if: {{{date|}}} |<nowiki> </nowiki>(Message added: {{{date}}}) }}</p><!--
  --></div><!-- end ambox content


* <code>|tiny=</code>: If set to <code>yes</code>, the box will have less padding and the icon will be much smaller than default.
--></div><!-- end ambox
* <code>|class=</code>: Any additional CSS classes to add to the ambox container element.
* <code>|date=</code>: The date the ambox was added to the page.
* <code>|nocat=</code>: If set to <code>yes</code>, no category will be added to the page. Use this only when creating documentation.


'''Note:''' Premade amboxes need the base {{tl|Ambox}} template to work.
--></includeonly><noinclude>
{| class="wikitable"
{{documentation}}
! Code !! Result
[[Category:Notice templates]]</noinclude>
|-
| {{tl|Cleanup}} || {{Cleanup|nocat=yes}}
|-
| {{tl|Delete}} || {{Delete|nocat=yes}}
|-
| <code><nowiki>{{</nowiki>[[Template:Merge|Merge]]|Example<nowiki>}}</nowiki></code> || {{Merge|Template:Ambox{{!}}Example|nocat=yes}}
|-
| <code><nowiki>{{</nowiki>[[Template:Move|Move]]|Example<nowiki>}}</nowiki></code> || {{Move|Template:Ambox{{!}}Example|nocat=yes}}
|-
| <code><nowiki>{{</nowiki>[[Template:Split|Split]]|Example<nowiki>}}</nowiki></code><br/><br/><code><nowiki>{{</nowiki>[[Template:Split|Split]]|Example 1|Example 2|Example 3<nowiki>}}</nowiki></code> || {{Split|Template:Ambox{{!}}Example|nocat=yes}}
{{Split|Template:Ambox{{!}}Example 1|Template:Ambox{{!}}Example 2|Template:Ambox{{!}}Example 3|nocat=yes}}
|-
| {{tl|Stub}} || {{Stub|nocat=yes}}
|-
 
|}
 
=== Informational amboxes ===
These amboxes are intended as permanent fixtures to a page, to notify visitors about some piece of information relevant to the page. These amboxes support the following parameters in addition to any listed:
 
* <code>|tiny=</code>, if set to <code>Yes</code> the image will be much smaller than default
* <code>|class=</code>, any additional classes to add to the ambox container
 
{| class="wikitable"
! Code !! Additional parameters !! Result
|-
| {{tl|Spoiler warning}} ||  || {{Spoiler warning|nocat=yes}}
|-
| {{tl|No direct use}} || || {{No direct use|nocat=yes}}
|-
| {{tl|Uses Lua}} || <code><nowiki>|1=</nowiki></code>, a comma-separated list of modules used || {{Uses Lua|nocat=yes}}
 
|}
 
=== Optional parameters ===
You can use optional parameters to further customize a premade ambox. The example below is using <code>tiny=yes</code> and <code>date=01/01/2021</code>.
{{Cleanup|tiny=yes|date=01/01/2021|nocat=yes}}
 
== Creating a custom ambox ==
You can create additional ambox templates as needed using the following parameters:
<pre>
{{Ambox
| color = The left border color.
| icon = The icon image to be displayed.
| title = The optional title.
| message = The explanation text displayed.
| tiny = If you want the tiny version of the ambox, fill the parameter with "yes".
| date = An optional date of creation for the message.
| class = An optional CSS class for the ambox.
}}
</pre>
 
== Dependencies ==
For this template to work properly, you need the following:
* <code>.ambox</code> and any related classes, found in [[MediaWiki:Common.css]].
<includeonly>[[Category:Notice templates]]</includeonly>
<noinclude>[[Category:Template documentation]]</noinclude>

Revision as of 07:15, 12 September 2024

Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:Ambox/doc/doc to edit this documentation. (How does this work?)
Template:Ambox/doc/doc