Difference between revisions of "Template:Check talk"

From blackwiki
Jump to navigation Jump to search
imported>Skomorokh
(per request)
imported>TheDJ
(simplify talk vs non-talk namespace detection, exclude this template page.)
Line 1: Line 1:
 
{{#switch:{{BASEPAGENAME}}
 
{{#switch:{{BASEPAGENAME}}
 +
|Check talk
 
  |Template messages
 
  |Template messages
 
  |Cleanup resources=  
 
  |Cleanup resources=  
  |#default={{#switch:{{NAMESPACE}}
+
  |#default={{#ifeq:{{NAMESPACE}} |{{SUBJECTSPACE}}
  |{{ns:0}}
+
  |<strong class="error">'''''This [[Wikipedia:template|template]] is misplaced.  It belongs on the [[Wikipedia:talk page|talk page]]:'' [[{{TALKPAGENAME}}]].'''</strong>
  |Wikipedia
 
  |User
 
  |Image
 
  |Category
 
  |Mediawiki
 
  |Portal
 
  |Help = <strong class=error>'''''This [[Wikipedia:template|template]] is misplaced.  It belongs on the [[Wikipedia:talk page|talk page]]:'' [[{{TALKPAGENAME}}]].'''</strong>
 
 
{{{category|[[Category:Main pages with misplaced talk page templates]]}}}
 
{{{category|[[Category:Main pages with misplaced talk page templates]]}}}
 
}}}}<includeonly>{{#ifeq:{{NAMESPACE}}|Template|{{{category|[[Category:Templates using check talk template|{{PAGENAME}}]]}}}}}</includeonly><noinclude>
 
}}}}<includeonly>{{#ifeq:{{NAMESPACE}}|Template|{{{category|[[Category:Templates using check talk template|{{PAGENAME}}]]}}}}}</includeonly><noinclude>

Revision as of 10:44, 30 October 2009

50px Template documentation[view] [edit] [history] [purge]

This is the {{check talk}} meta-template.

This template is invisible except under the conditions described below.

Usage

This template may be incorporated into other templates that are intended to be used only on talk pages. If a template containing it is added to a page in any subject namespace, then a warning message will be displayed encouraging people to use that template only on talk pages. The current text of the warning message is:

This template is misplaced. It belongs on the talk page: Template talk:Check talk.

It also adds the pages to Category:Pages with misplaced templates for easier tracking and rectification.

This template can simply be used like this:

{{check talk}}

But if you want to have the ability to selectively turn off this template, for instance when you show your template on a WikiProject page, then use this template like this:

{{check talk| nocat={{{nocat|}}} }}

Then you can feed "nocat = true" to your template when you demonstrate it on a page, and then this template will not show any error message and will not categorize it.

See also

  • {{check talk wp}} – For templates that should be used only on talk pages and "Wikipedia:" space.
  • {{talk other}} – Helps you detect any talk space, if you want to design your own message.