Last modified: 2009-07-24 12:08:42 UTC
Dear friends, I try to build two versions of a list from http://test.wikipedia.org/wiki/User:Gangleri/tests/list_% 28template%29 . One is for maintenance: http://test.wikipedia.org/wiki/User:Gangleri/tests/list_% 28maintenance%29 and the other should be an article http://test.wikipedia.org/wiki/User:Gangleri/tests/list . There are two ways to do this: a) an "empty template" as {{|parameter1|parameter2}} should not be displayed / should be ignored; please note that no template_name is included b) some if ($template_name == "") depending on implementation if ($template_name IS NULL) Regards
A turnaround was found. See http://en.wikipedia.org/wiki/User_talk:Patrick#Janus_article . - The "old" example is still available at http://test.wikipedia.org/wiki/User:Gangleri/tests/list_%28old_test_01%29. - http://test.wikipedia.org/wiki/User:Gangleri/tests/list does what was intended to be done. I would be happy if this would be a permanent feature and not a ("possible") "site effect". - If the behaviour of "an empty template" would be changed a new solition should be found. ---- A construct as if ($template_name == "") [depending on implementation if ($template_name IS NULL)] would allow easy insertions (also headers, trailers, ...) to an article. Regards Reinhardt
To clarify, as I understand it, the context is that "{{{{x}}|y|z}}" could be used to pass a template as a parameter to another template, allowing things to be formatted differently. But in order to omit the statement completely, you can't just pass "|x= |", because that leaves you with {{|y|z}}, which is invalid syntax. The workaround is to use an existing but empty template as the parameter, so the text becomes "{{blank_template|y|z}}", and (since Template:Blank_template contains no text) is rendered blank. I see no reason why this behaviour will ever change, as it is not a side-effect at all: the template is simply being included; if it contained the single letter "A", the result would be the single letter "A". Passing extra parameters to a template has no effect, and nor should it.
Why not make a Template:Empty or Template:Blank and get the effect of non-inclusion of the template simply by including a template that would produce no text?
note on comment 2 > The workaround is to use an existing but empty template as the parameter, so the > text becomes "{{blank_template|y|z}}", and (since Template:Blank_template > contains no text) is rendered blank. ... see also bug 2288 comment 3 bug 2288: Suggestion: links to empty pages should show up as uncreated
I don't see a need for a software solution to this: the use of a blank template as suggested in comment 2 is a completely stable way to achieve this effect. The potential issue raised in commet 4 (bug 3843: treat links to blank pages as links to nonexistent pages) has been WONTFIXed, partly because of issues with syntax like this. Also totally stale.