Template:Void

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search
Template documentation[view] [edit] [page history] [purge]
Similar templates at English sister projects
Wikimedia-logo.svg Meta Void
Wikipedia-logo.png Wikipedia Void
Commons-logo.svg Commons Void
Wikibooks-logo.svg Wikibooks Void
Wikinews-logo.svg Wikinews void
Wikispecies-logo.svg Wikispecies Void
Wikiversity-logo.svg Wikiversity Void

This template returns the empty string.

Usage

Parser functions for branching (#if, #ifeq, #ifexpr, #ifexist, #iferror, #switch) trim the result. To be able to specify a result starting and/or ending with newlines and/or spaces, the possible results specified in the call of such a branching function (then-part, else-part, switch values) are template names, and the parser function call forms the title part inside a pair of double braces. Unnamed parameters in this outer call are not trimmed. If there is a then-part but no else-part, or in the case of #switch without default, the corresponding template name has to return the empty string regardless of any parameters specified in the call. This is achieved by using this template.

The template is used in:

Alternatives

It is also possible to use parser function {{ns:0}} (the empty string for the main namespace). However, any parameters of {{ns:0}} contribute to the post-expand include size, while this is not the case with this template.

{{{{#if..:..|a|void}}|b}} is equivalent with {{{{#if..:..|a|p2}}|b|}} provided that {{a|b}} is equivalent with {{a|b|}}, e.g. because template A does not use a parameter 2, or because it treats empty and undefined the same.

Examples

  • "{{void}}" → "" [1].
  • "{{void|p}}" → "" [2].
  • {{tt|void}} using Template:Tt containing "{{{{{1}}}|a{{{2}}}b{{{2}}}c{{{2}}}d}}" gives "".

Compare:

  • "{{ns:0}}" → "" [3].
  • "{{ns:0|p}}" → "" [4].
  • {{tt|ns:0}} gives "".

Comments

The template can be used for adding comments in the wiktext, without affecting the rendering. In the usual way it can be controlled whether on substitution of a template containing a call of void it is substituted (i.e., the comment is removed) or not. See also Help:Substitution#Multilevel substitution and Help:Comment tags#Substitution.

See also
http://meta.wikimedia.org/wiki/Template:Void
meta.wikimedia.org
crawl=CC-MAIN-2014-52
30286
application/http; msgtype=response
sha1:VWLY6OJ4RCEJBDMBEB3HBLL6UMFQQOD3
<urn:uuid:9c0cccad-1ac9-47dc-80d6-c6e5bf3f0d4d>
2014-12-22T17:08:49Z
208.80.154.224
sha1:LRK4LUVSU2MVR5QQKQU5YRASF2A6CZ7N
<urn:uuid:50206c4e-1918-4094-873b-eb419813cfb0>
http://meta.wikimedia.org/wiki/Template:Void
response
<urn:uuid:6a433efc-9c5d-4080-a3ef-d2af48544e6e>
robots: classic
hostname: ip-10-231-17-201.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2014-52
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for December 2014
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf