Difference between revisions of "Šablóna:Mbox/core"

From Wazeopedia
(Copy from mediawiki Template:Mbox/core)
m (26 revízií)
 
(29 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<table class="metadata plainlinks mbox {{#switch:{{{small|}}}
+
<table style="
| left = mbox-small-left
+
  border: 1px solid rgb(170, 170, 170);
}} {{#switch:{{{type|}}}
+
   margin: 4px 5%;
| speedy    =
+
   border-collapse: collapse;
| critical   = mbox-critical
+
   background: none repeat scroll 0% 0% rgb(249, 249, 249);
| delete
+
{{{style|}}}">
| important  = mbox-important
 
| warning   
 
| content    = mbox-warning
 
| caution   
 
| style      = mbox-caution
 
| notice    = mbox-notice
 
| move      = mbox-move
 
| protection = mbox-protection
 
| notice
 
| license   = mbox-license
 
| #default   = <!-- no type colours -->
 
}}" style="{{{style|}}}">
 
 
<tr>
 
<tr>
 
{{#switch:{{{image|}}}
 
{{#switch:{{{image|}}}
 
| none = <td class="mbox-empty-cell"></td>  <!-- No image. Cell with some width or padding necessary for text cell to have 100% width. -->
 
| none = <td class="mbox-empty-cell"></td>  <!-- No image. Cell with some width or padding necessary for text cell to have 100% width. -->
 
| #default =  
 
| #default =  
   <td class="mbox-image">{{
+
   <td style="
 +
  border: medium none;
 +
  padding: 2px 0px 2px 0.9em;
 +
  text-align: center;
 +
">{{
 
   #switch:{{{small|}}}
 
   #switch:{{{small|}}}
 
   | left = <!-- Don't use the DIV -->  
 
   | left = <!-- Don't use the DIV -->  
Line 29: Line 21:
 
   | {{{image}}}
 
   | {{{image}}}
 
   | [[File:{{#if: {{{filename|}}} | {{{filename}}} | {{#switch:{{{type|}}}
 
   | [[File:{{#if: {{{filename|}}} | {{{filename}}} | {{#switch:{{{type|}}}
     | critical   = Ambox warning pn.svg
+
     | critical     = Mbox warning.png
     | important  = Ambox warning pn.svg
+
     | warning      = mbox warning yellow.png
     | warning   = Ambox important.svg
+
     | important   = Mbox important.png
     | caution   = Edit-clear.svg
+
     | caution     = Mbox caution.png
     | move       = Ambox move.png
+
    | speculation  = Mbox speculation.png
     | protection = Ambox protection.png
+
     | move         = Mbox move.png
     | license = Imbox license.png
+
     | protection   = Mbox protection.png
     | notice         <!-- notice = default -->
+
     | license     = Mbox license.png
     | #default   = Information icon4.svg
+
    | construction = Mbox construction yellow.png
 +
    | neweditor    = Mbox new editor.png
 +
    | mail        = Mbox mail.png
 +
    | forum        = Gnome-system-users.svg.png
 +
    | cleanup      = Edit-clear.png
 +
    | wiki        = wikitext.png
 +
     | notice       <!-- notice = default -->
 +
     | #default     = Mbox information.png
 
     }} }} | {{#switch:{{{small|}}}  
 
     }} }} | {{#switch:{{{small|}}}  
 
       | left = 20x20px  
 
       | left = 20x20px  
Line 47: Line 46:
 
   }}</td>
 
   }}</td>
 
}}
 
}}
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} </td>
+
<td style="
 +
  width: 100%;
 +
  border: medium none;
 +
  padding: 0.25em 0.9em;
 +
{{{textstyle|}}}"> {{{text}}} </td>
 
{{#if:{{{imageright|}}}
 
{{#if:{{{imageright|}}}
 
| {{#ifeq:{{{imageright|}}}|none
 
| {{#ifeq:{{{imageright|}}}|none
Line 59: Line 62:
 
</tr>
 
</tr>
 
</table><noinclude>
 
</table><noinclude>
{{documentation}}
+
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
+
{{Documentation|content=This subtemplate supports the default values of {{tl|Mbox}}. It should not be altered without review from a Wiki Expert. Contact one through the [http://www.waze.com/forum/viewforum.php?f=276 Wiki Updates and Discussion forum.]}}
 +
 
 +
<!-- This category is only for the template itself -->
 +
 
 +
[[Category:Template:Mbox]]
 +
 
 
</noinclude>
 
</noinclude>

Latest revision as of 20:52, 19 June 2016

{{{text}}}
Documentation icon Template documentation[view] [edit] [history] [purge]

This template automatically displays a documentation box like you are seeing now, of which the content is transcluded from another page. It is intended for pages which are transcluded in other pages, i.e. templates, whether in the template namespace or not.

Usage

Normal

<noinclude>{{documentation}}</noinclude>
 - or -
<noinclude>{{doc}}</noinclude>
 - or -
<noinclude>{{documentation|template:any page/doc}}</noinclude>

This code should be added at the bottom of the template code, with no extra space before "<noinclude>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.

Add categories and interwiki links to the documentation page inside <includeonly> tags.

If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "&lt;", and the ">" with "&gt;.

Customizing display

Overrides exist to customize the output in special cases:

  • {{documentation|heading=}}: change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.
  • {{documentation|content=}}: for extremely simple documentation notes, enter the message desired with the |content= parameter. The text provided with this parameter appears in a box similar to the doc subpage, without any other notations in the boxes. For more complex documentation descriptions, use a full doc subpage.

Functions

If the documentation page doesn't exist, the "edit" link includes a preload parameter so that clicking it will pre-fill the edit form with the basic documentation page format.

Rationale

This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template's documentation, categories, and interwiki links. It also reduces server resources by circumventing a technical limitation of templates (see a developer's explanation).

The above documentation is transcluded from Template:Documentation/doc.
Please add categories to the /doc subpage.
Subpages of this template.