Difference between revisions of "Template:Ambox"

From AIE Wiki
Jump to: navigation, search
(Undid revision 397582199 by Rjanag (talk) should not rely on numbered parameters; text is not guaranteed to be {{{1}}}.)
(adding functionality for substitution detection and cleanup categorisation, per discussion)
Line 1: Line 1:
<!--{{Ambox}} begin-->{{#switch:{{{small|}}}
+
{{#ifeq:{{{subst}}}|SUBST
| left =
+
|{{#if:{{{name|}}}
  {{Ambox/core
+
   |{{error|Template {{tlx|{{{name}}}}} has been incorrectly substituted.}}
  | small      = left
+
}}[[Category:Pages with incorrectly substituted templates]]
  | type      = {{{type|}}}
+
}}{{#ifeq:{{{small}}}|left
   | image      = {{#if:{{{smallimage|}}}
+
|{{Ambox/core
                | {{{smallimage}}}
+
   |small     = left
                | {{{image|}}}
+
   |type      = {{{type|}}}
                }}
+
   |image      = {{#if:{{{smallimage|}}}
  | imageright = {{#if:{{{smallimageright|}}}
+
  |{{{smallimage}}}
                | {{{smallimageright}}}
+
  |{{{image|}}}
                | {{{imageright|}}}
+
                }}
+
   | style     = {{{style|}}}
+
   | textstyle  = {{{textstyle|}}}
+
   | text      = {{#if:{{{smalltext|}}}
+
                | {{{smalltext}}}  
+
                | {{{text}}}
+
                }}
+
 
   }}
 
   }}
| #default =  
+
  |imageright = {{#if:{{{smallimageright|}}}
  {{Ambox/core
+
  |{{{smallimageright}}}
  | type      = {{{type|}}}
+
  |{{{imageright|}}}
  | image      = {{{image|}}}
+
  | imageright = {{{imageright|}}}
+
  | style      = {{{style|}}}
+
  | textstyle  = {{{textstyle|}}}
+
  | text      = {{{text}}}
+
 
   }}
 
   }}
}}<!--
+
  |style      = {{{style|}}}
 
+
  |textstyle  = {{{textstyle|}}}
--><includeonly>{{#ifeq:{{BASEPAGENAME}}|{{SUBPAGENAME}}|{{#ifeq:{{NAMESPACE}}|Template|[[Category:Article message boxes]]}}}}</includeonly><!--
+
  |text      = {{#if:{{{smalltext|}}}
 
+
  |{{{smalltext}}}
--><!--{{Ambox}} end--><noinclude>
+
  |{{{text}}}
 +
  }}
 +
}}
 +
|{{Ambox/core
 +
  |type      = {{{type|}}}
 +
  |image      = {{{image|}}}
 +
  |imageright = {{{imageright|}}}
 +
  |style      = {{{style|}}}
 +
  |textstyle  = {{{textstyle|}}}
 +
  |text      = {{{text}}}
 +
}}
 +
}}{{cat handler
 +
|main={{#if:{{{cat|}}}
 +
  |{{#if:{{{date|}}}
 +
  |[[Category:{{{cat}}} {{{preposition|from}}} {{{date}}}]]{{#ifexist:Category:{{{cat}}} {{{preposition|from}}} {{{date}}}|
 +
    |[[Category:Articles with invalid date parameter in template]]
 +
  }}
 +
  |[[Category:{{#if:{{{undated|}}}
 +
    |{{{undated}}}
 +
    |{{{cat}}}
 +
  }}]]
 +
  }}
 +
}}{{#if:{{{all|}}}
 +
  |[[Category:{{{all}}}]]
 +
}}
 +
|template={{#ifeq:{{BASEPAGENAME}}|{{SUBPAGENAME}}|[[Category:Article message boxes]]}}
 +
}}{{#ifeq:{{FULLROOTPAGENAME}}|Template:{{PAGENAME:{{{name}}}}}
 +
|{{documentation}}<!-- Transclude documentation on template page -->
 +
}}<noinclude>
  
 
{{Documentation}}
 
{{Documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Revision as of 17:15, 13 February 2011

Template:Cat handler
50px Template documentation[view] [edit] [history] [purge]

This is the {{Ambox}} or Article message box meta-template.

Type preview

See also

50px Message box templates {{ambox}}{{asbox}}{{cmbox}}{{dmbox}}{{fmbox}}{{imbox}}{{ombox}}{{tmbox}}

Other pages:


Language: English