Template:Mbox: Difference between revisions

From PZwiki
m (update doc)
(prepare for Template:Note)
Line 18: Line 18:
:Mbox image. Default is <code><nowiki>[[File:Imbox content.png|link=]]</nowiki></code>.
:Mbox image. Default is <code><nowiki>[[File:Imbox content.png|link=]]</nowiki></code>.
;<code>title</code>
;<code>title</code>
:Mbox title. Displayed in bold and large font. Default is <code>This is an Mbox.</code>.
:Mbox title. Displayed in bold and large font.
;<code>content</code>
;<code>content</code>
:Normal text. Default is <code>This is content of the Mbox.</code>.
:Normal text.
;<code>note</code>
;<code>note</code>
:Bottom text. Displayed in italic and small font. Will be empty if not specified.
:Bottom text. Displayed in italic and small font.
;<code>cat</code>
;<code>cat</code>
:Category name, omit <code>Category:</code> prefix. Will be empty if not specified.
:Category name, omit <code>Category:</code> prefix.
;<code>id</code>
;<code>id</code>
:Id for each Mbox to collapse the content. Should be unique. Recommended to use <code>mbox-xxx</code> format. Default is <code>mbox</code>.
:Id for each Mbox to collapse the content. Should be unique. Recommended to use <code>mbox-xxx</code> format. The mbox will not be collapsible if not specified.
;<code>collapsed</code>
;<code>collapsed</code>
:Initial state of the content. Will be collapsed if specified.
:Initial state of the content. Will be collapsed if specified. Only works when <code>id</code> is specified.


==Example==
==Example==
Line 62: Line 62:
{{ll|Category:Metatemplates}}
{{ll|Category:Metatemplates}}
{{ll|Category:Mbox templates}}
{{ll|Category:Mbox templates}}
</noinclude><includeonly><div class="mbox" {{#if:{{{background|}}}|style="background-color: {{{background}}};"}}>{{#if:{{{cat|}}}|[[Category:{{{cat}}}]]}}
</noinclude><includeonly><div class="mbox" {{#if:{{{background|}}}|style="background-color: {{{background}}};"}}>
   <div {{#if:{{{color|}}}|style="background-color: {{{color}}};"}}></div>
   <div {{#if:{{{color|}}}|style="background-color: {{{color}}};"}}></div>
   <div class="mw-collapsible {{#if:{{{collapsed|}}}|mw-collapsed}}" id="mw-customcollapsible-{{#if:{{{id|}}}|{{{id}}}|mbox}}">{{#if:{{{sign|}}}|{{{sign}}}|[[File:Imbox content.png|link=]]}}</div>
   <div {{#if:{{{id|}}}
   <div class="mbox-toggle mw-customtoggle-{{#if:{{{id|}}}|{{{id}}}|mbox}}" title="toggle">◥</div>
    | class="mw-collapsible {{#if:{{{collapsed|}}}|mw-collapsed}}" id="mw-customcollapsible-{{{id}}}"
    }}>{{#if:{{{sign|}}}|{{{sign}}}|[[File:Imbox content.png|link=]]}}</div>
   {{#if:{{{id|}}}
  | <div class="mbox-toggle mw-customtoggle-{{{id}}}" title="toggle">◥</div>
  }}
   <div>
   <div>
     <div style="font-size: 120%; font-weight: bold;">{{#if:{{{title|}}}|{{{title}}}|Mbox title.}}</div>
     {{#if:{{{title|}}}
     <div class="mw-collapsible {{#if:{{{collapsed|}}}|mw-collapsed}}" id="mw-customcollapsible-{{#if:{{{id|}}}|{{{id}}}|mbox}}">{{#if:{{{content|}}}|{{{content}}}|Mbox content.}}</div>
    | <div style="font-size: 120%; font-weight: bold;">{{{title}}}</div>
    }}
     <div {{#if:{{{id|}}}
      | class="mw-collapsible {{#if:{{{collapsed|}}}|mw-collapsed}}" id="mw-customcollapsible-{{{id}}}"
      }}>{{#if:{{{content|}}}|{{{content}}}}}</div>
     {{#if: {{{note|}}}
     {{#if: {{{note|}}}
     | <div class="mw-collapsible {{#if:{{{collapsed|}}}|mw-collapsed}}" id="mw-customcollapsible-{{#if:{{{id|}}}|{{{id}}}|mbox}}" style="font-size: 80%; font-style: italic;">{{{note}}}</div>
     | <div {{#if:{{{id|}}}
        | class="mw-collapsible {{#if:{{{collapsed|}}}|mw-collapsed}}" id="mw-customcollapsible-{{{id}}}"
        }} style="font-size: 80%; font-style: italic;">{{{note}}}</div>
     }}
     }}
   </div>
   </div>
</div></includeonly>
</div>{{#if:{{{cat|}}}|[[Category:{{{cat}}}]]}}</includeonly>

Revision as of 07:17, 30 December 2023

Notebook.pngTemplate Documentation

This template is used to create a collapsible mbox.

This is a collapsible element. You can toggle it by clicking the "◥" sign on the top-right corner.

When collapsed, the image, content and note will be hidden, only the title will be displayed.

Usage

Do not use this template directly, instead use one of the types listed in PZwiki:Mboxes.

Parameters

background
Background color. Default is #f8f9fa.
color
Left bar color. Default is #f28500.
sign
Mbox image. Default is [[File:Imbox content.png|link=]].
title
Mbox title. Displayed in bold and large font.
content
Normal text.
note
Bottom text. Displayed in italic and small font.
cat
Category name, omit Category: prefix.
id
Id for each Mbox to collapse the content. Should be unique. Recommended to use mbox-xxx format. The mbox will not be collapsible if not specified.
collapsed
Initial state of the content. Will be collapsed if specified. Only works when id is specified.

Example

{{Mbox
| background = #f8f9fa
| color = #f28500
| sign = [[File:Imbox content.png|link=]]
| title = This is an Mbox.
| content = This is content of the Mbox.
| note = This is a note of the Mbox.
| id = mbox
| collapsed = true
}}
Imbox content.png
This is an Mbox.
This is content of the Mbox.
This is a note of the Mbox.

How to translate

This template doesn't need to/shouldn't be translated, but you can translate the documentation of this template with the following steps:

  1. Create a subpage of this template with the language code of the language you want to translate to.
  2. Copy the code wrapped in the <noinclude> tag in this template into the page you created.
    {{Translation guide}} template should be removed from the translated documentation.
  3. Translate the page according to the translation requirements of normal pages.

See also

Editors can experiment in this template's sandbox.