This is a wiki for a reason. Anyone can contribute. If you see something that is inaccurate or can be improved, don't ask that it be fixed--just improve it.
[ Disclaimer, Create new user --- Wiki markup help, Install P99 ]

Difference between revisions of "Template:!"

From Project 1999 Wiki
Jump to: navigation, search
(Created page with "|<noinclude>{{historical|This was a common template on just about every wiki which was replaced in mid 2014 (for 1.24 release) in favour of a parser function doing the same th...")
 
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
|<noinclude>{{historical|This was a common template on just about every wiki which was replaced in mid 2014 (for 1.24 release) in favour of a parser function doing the same thing. See [[gerrit:136234]]}}{{ {{TNTN|documentation}} |content=
+
<includeonly>|</includeonly><noinclude>
 +
''As of 2014 (verison 1.24) this was supposed to be built-in a "magic word" ... but for some reason it's not (even though we're using version 1.3).  Since it's not, this template (based on the template MediaWiki used before the magic word was added) is used here instead.
  
''As of 2014 this is now a "magic word", the template can be deleted or kept as dummy.''
+
All this template does is replace itself with a single "pipe" or "|" character, but this is valuable as it allows templates to take other templates as arguments. Without using this, the inner template's "|" will be counted as part of the outer template, breaking things.  If this template is used instead of the "|" symbol (in the inner template), both templates can still work together.''
 
+
</noinclude>
This template existed to provide a way to easily escape the raw pipe character (<code><nowiki>|</nowiki></code>) in a situation where markup containing it (i.e. a {{ll|Help:Tables|wikitable}}) needs to be passed as a parameter to a template. Parser functions will mangle wikitable syntax and pipe characters, treating all the raw pipe characters as parameter dividers. This template 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded. It will then be interpreted as a table row or column separator.
+
 
+
== See also ==
+
 
+
* {{ll|Help:Extension:ParserFunctions#Escaping_pipe_characters_in_tables|Escaping pipe characters in tables}}
+
 
+
[[Category:Workaround templates]]
+
 
+
}}</noinclude>
+

Latest revision as of 19:02, 16 June 2020

As of 2014 (verison 1.24) this was supposed to be built-in a "magic word" ... but for some reason it's not (even though we're using version 1.3). Since it's not, this template (based on the template MediaWiki used before the magic word was added) is used here instead.

All this template does is replace itself with a single "pipe" or "|" character, but this is valuable as it allows templates to take other templates as arguments. Without using this, the inner template's "|" will be counted as part of the outer template, breaking things. If this template is used instead of the "|" symbol (in the inner template), both templates can still work together.