Template:DYK mbox: Difference between revisions
John Cline (talk | contribs) add<includeonly></includeonly> |
John Cline (talk | contribs) use |content= |
||
Line 1: | Line 1: | ||
{{{{{|safesubst:}}}#switch:{{{1}}} |
{{{{{|safesubst:}}}#switch:{{{1}}} |
||
| user |
| user |
||
| #default= |
| #default={{documentation|content=<noinclude> |
||
;This template uses the following internal syntax: |
;This template uses the following internal syntax: |
||
<code><nowiki><table class="{{#if:{{{table class|}}}|{{{table class}}}|plainlinks ombox dykbox-notice}}" style="{{#if:{{{table style|}}}|{{{table style}}}|}}">{{#if:{{{table header|}}}|{{{table header}}}|}}{{#if:{{{table row|}}}|{{{table row}}}|<tr>}}{{#if:{{{table data|}}}|{{{table data}}}|<td class="mbox-image">{{#if:{{{file|}}}|[[File:{{{file}}}|{{#if:{{{file size|}}}|{{{file size}}}x{{{file size}}}px|33x33px}}|{{#if:{{{file link|}}}|link={{{file link}}}|link=}}|{{#if:{{{alter|}}}|alt={{{alter}}}|alt=}}]]|[[File:GAflag.gif|33x33px|link=|alt=]]}}</td><td class="mbox-text" style="{{#if:{{{td style|}}}|{{{td style}}}|}}">{{{text}}}</td>}}{{#if:{{{file2|}}}|<td><span style="float:right">{{{file2}}}</span></td>|}}</tr></table></nowiki></code> |
<code><nowiki><table class="{{#if:{{{table class|}}}|{{{table class}}}|plainlinks ombox dykbox-notice}}" style="{{#if:{{{table style|}}}|{{{table style}}}|}}">{{#if:{{{table header|}}}|{{{table header}}}|}}{{#if:{{{table row|}}}|{{{table row}}}|<tr>}}{{#if:{{{table data|}}}|{{{table data}}}|<td class="mbox-image">{{#if:{{{file|}}}|[[File:{{{file}}}|{{#if:{{{file size|}}}|{{{file size}}}x{{{file size}}}px|33x33px}}|{{#if:{{{file link|}}}|link={{{file link}}}|link=}}|{{#if:{{{alter|}}}|alt={{{alter}}}|alt=}}]]|[[File:GAflag.gif|33x33px|link=|alt=]]}}</td><td class="mbox-text" style="{{#if:{{{td style|}}}|{{{td style}}}|}}">{{{text}}}</td>}}{{#if:{{{file2|}}}|<td><span style="float:right">{{{file2}}}</span></td>|}}</tr></table></nowiki></code> |
||
Line 7: | Line 7: | ||
<code><nowiki><table class="plainlinks ombox dykbox-notice" style=""><tr><td class="mbox-image">[[File:GAflag.gif|33x33px|link=|alt=]]</td><td class="mbox-text" style="">{{{text}}}</td></tr></table></nowiki></code> |
<code><nowiki><table class="plainlinks ombox dykbox-notice" style=""><tr><td class="mbox-image">[[File:GAflag.gif|33x33px|link=|alt=]]</td><td class="mbox-text" style="">{{{text}}}</td></tr></table></nowiki></code> |
||
;which produces<nowiki>:</nowiki></noinclude> |
;which produces<nowiki>:</nowiki></noinclude> |
||
<table class="{{#if:{{{table class|}}}|{{{table class}}}|plainlinks ombox dykbox-notice}}" style="{{#if:{{{table style|}}}|{{{table style}}}|}}">{{#if:{{{table header|}}}|{{{table header}}}|}}{{#if:{{{table row|}}}|{{{table row}}}|<tr>}}{{#if:{{{table data|}}}|{{{table data}}}|<td class="mbox-image">{{#if:{{{file|}}}|[[File:{{{file}}}|{{#if:{{{file size|}}}|{{{file size}}}x{{{file size}}}px|33x33px}}|{{#if:{{{file link|}}}|link={{{file link}}}|link=}}|{{#if:{{{alter|}}}|alt={{{alter}}}|alt=}}]]|[[File:GAflag.gif|33x33px|link=|alt=]]}}</td><td class="mbox-text" style="{{#if:{{{td style|}}}|{{{td style}}}|}}">{{{text}}}</td>}}{{#if:{{{file2|}}}|<td><span style="float:right">{{{file2}}}</span></td>|}}</tr></table><noinclude>{{center|'''Refer to the main documentation for optional parameters, and examples of useage'''.}}</noinclude> |
<table class="{{#if:{{{table class|}}}|{{{table class}}}|plainlinks ombox dykbox-notice}}" style="{{#if:{{{table style|}}}|{{{table style}}}|}}">{{#if:{{{table header|}}}|{{{table header}}}|}}{{#if:{{{table row|}}}|{{{table row}}}|<tr>}}{{#if:{{{table data|}}}|{{{table data}}}|<td class="mbox-image">{{#if:{{{file|}}}|[[File:{{{file}}}|{{#if:{{{file size|}}}|{{{file size}}}x{{{file size}}}px|33x33px}}|{{#if:{{{file link|}}}|link={{{file link}}}|link=}}|{{#if:{{{alter|}}}|alt={{{alter}}}|alt=}}]]|[[File:GAflag.gif|33x33px|link=|alt=]]}}</td><td class="mbox-text" style="{{#if:{{{td style|}}}|{{{td style}}}|}}">{{{text}}}</td>}}{{#if:{{{file2|}}}|<td><span style="float:right">{{{file2}}}</span></td>|}}</tr></table><noinclude>{{center|'''Refer to the main documentation for optional parameters, and examples of useage'''.}}</noinclude>}} |
||
|defcode= |
|defcode= |
||
<code><nowiki><table class="{{#if:{{{table class|}}}|{{{table class}}}|plainlinks ombox dykbox-notice}}" style="{{#if:{{{table style|}}}|{{{table style}}}|}}">{{#if:{{{table header|}}}|{{{table header}}}|}}{{#if:{{{table row|}}}|{{{table row}}}|<tr>}}{{#if:{{{table data|}}}|{{{table data}}}|<td class="mbox-image">{{#if:{{{file|}}}|[[File:{{{file}}}|{{#if:{{{file size|}}}|{{{file size}}}x{{{file size}}}px|33x33px}}|{{#if:{{{file link|}}}|link={{{file link}}}|link=}}|{{#if:{{{alter|}}}|alt={{{alter}}}|alt=}}]]|[[File:GAflag.gif|33x33px|link=|alt=]]}}</td><td class="mbox-text" style="{{#if:{{{td style|}}}|{{{td style}}}|}}">{{{text}}}</td>}}{{#if:{{{file2|}}}|<td><span style="float:right">{{{file2}}}</span></td>|}}</tr></table></nowiki></code> |
<code><nowiki><table class="{{#if:{{{table class|}}}|{{{table class}}}|plainlinks ombox dykbox-notice}}" style="{{#if:{{{table style|}}}|{{{table style}}}|}}">{{#if:{{{table header|}}}|{{{table header}}}|}}{{#if:{{{table row|}}}|{{{table row}}}|<tr>}}{{#if:{{{table data|}}}|{{{table data}}}|<td class="mbox-image">{{#if:{{{file|}}}|[[File:{{{file}}}|{{#if:{{{file size|}}}|{{{file size}}}x{{{file size}}}px|33x33px}}|{{#if:{{{file link|}}}|link={{{file link}}}|link=}}|{{#if:{{{alter|}}}|alt={{{alter}}}|alt=}}]]|[[File:GAflag.gif|33x33px|link=|alt=]]}}</td><td class="mbox-text" style="{{#if:{{{td style|}}}|{{{td style}}}|}}">{{{text}}}</td>}}{{#if:{{{file2|}}}|<td><span style="float:right">{{{file2}}}</span></td>|}}</tr></table></nowiki></code> |
Revision as of 10:36, 28 January 2013
- This template uses the following internal syntax
<table class="{{#if:{{{table class|}}}|{{{table class}}}|plainlinks ombox dykbox-notice}}" style="{{#if:{{{table style|}}}|{{{table style}}}|}}">{{#if:{{{table header|}}}|{{{table header}}}|}}{{#if:{{{table row|}}}|{{{table row}}}|<tr>}}{{#if:{{{table data|}}}|{{{table data}}}|<td class="mbox-image">{{#if:{{{file|}}}|[[File:{{{file}}}|{{#if:{{{file size|}}}|{{{file size}}}x{{{file size}}}px|33x33px}}|{{#if:{{{file link|}}}|link={{{file link}}}|link=}}|{{#if:{{{alter|}}}|alt={{{alter}}}|alt=}}]]|[[File:GAflag.gif|33x33px|link=|alt=]]}}</td><td class="mbox-text" style="{{#if:{{{td style|}}}|{{{td style}}}|}}">{{{text}}}</td>}}{{#if:{{{file2|}}}|<td><span style="float:right">{{{file2}}}</span></td>|}}</tr></table>
- The internal template code for the default switch,
{{DYK/mbox}}
, produces the following output:
<table class="plainlinks ombox dykbox-notice" style=""><tr><td class="mbox-image">[[File:GAflag.gif|33x33px|link=|alt=]]</td><td class="mbox-text" style="">{{{text}}}</td></tr></table>
- which produces:
{{{text}}} |
{{DYK mbox}}
is a messaging utility template for posting messages related to Did you know operations. It also supports other templates, internally—to facilitate interactive ease of use, on special pages, and editing scripts, used for the administration of Did you know.
Template {{DYK mbox}}
This template was developed for the specialized needs of Did you know.
Usage
Either the basic syntax, {{DYK mbox}}
or the shortcut, {{DYKM}}
will produce:
Template loop detected: Template:Documentation
You can either use {{DYKM|text=Inserts your custom message.}}
, or default through the unnamed parameter switch, {{DYKM|Inserts your custom message.}}
to produce the following:
Template loop detected: Template:Documentation
Or you could use a non printable character in place of the image {{DYKM|file= |text}}
which maintains the image's margin as if it were in place and the size of the box is maintained as shown below:
Template loop detected: Template:Documentation
The |small=
parameter switches from the 80% width, center aligned, message box to a smaller box that aligns to the right side of the line it is added to. It uses similar parameters as the main box except they begin with a small s, for example the text parameter for the small box is |1=
. Therefor the following code: {{DYKM|small=y|1=This is the small box text}}
produces the following:
Template loop detected: Template:Documentation
Several other parameters are incorporated that modify the template's output for specialized use (examples are shown below)).
Examples
Custom messaging examples are included as expandable content.
Expand examples → → → |
---|
You can stack the template to produce multiple rows.
To produce:
Template loop detected: Template:Documentation Template loop detected: Template:Documentation Full code
{{DYKM | small = Changes from the larger box to a smaller one | file = Allows the left side image to be changed | text = (or the |1#switch) Allows a custom text message | file2 = Allows a right side image | sfile2 = Adds a right side image for the small-box }} |