Template:Ambox: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Edokter
Undid revision 397582199 by Rjanag (talk) should not rely on numbered parameters; text is not guaranteed to be {{{1}}}.
meta>MSGJ
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:Ambox/coreTemplate:Cat handler