Template talk:Empty
Jump to navigation
Jump to search
Documentation[edit]
Could somebody improve the documentation so I understnad this template? --Slomox (talk) 22:16, 3 September 2010 (UTC)
- The documentation isn't very clear, but it's just an empty template, like {{Void}} (where you asked a similar question). I gave a couple examples, but here's another use I never thought about before. In that case it functions like a null device rather than an empty string. Rocket000 (talk) 23:40, 3 September 2010 (UTC)
- where you asked a similar question Yes, my question seemed kinda dejavu-ish ;-)
- And I still don't get it... :-( I admit, the example at en: is an working application of the template, but the same could be done with a simple HTML comment, couldn't it? (And it would be more parser-friendly too.) --Slomox (talk) 00:57, 4 September 2010 (UTC)
- Okay, I analyzed one of the use cases and it seems this is used as a way to make a construct like {{ {{#if: {{{1|}}} | TemplateName | empty }} }} work without ending up with an unparseable {{}}.
- The remaining question is just: What's wrong with {{#if: {{{1|}}} | {{TemplateName}} | }}? --Slomox (talk) 01:07, 4 September 2010 (UTC)
- To be honest, it's been awhile since I've had to use a template like this so I kinda forgot the details concerning it's use and why it's better than alternatives in some cases. One reason, a minor one, is it is more efficient than using a parser function (#if or ns:0). If you really want to look into it more, take a look at m:Template:Void and it's example templates. Meta has a lot of template documentation on these kind of things. I learned a lot of tricks from there (most of them have little use, but it's still interesting on an academic level). Rocket000 (talk) 02:57, 4 September 2010 (UTC)
- Oh, and the difference with using HTML comments is they don't disappear after saving (subst'ing empty templates does). Rocket000 (talk) 03:03, 4 September 2010 (UTC)